def extract_arguments(fh):
    datasets = []
    while True:
        H, W = map(int, fh.readline().strip().split())
        if H == 0 and W == 0:
            break
        matrix = []
        for _ in range(H):
            matrix.append(list(map(int, fh.readline().strip().split())))
        datasets.append((H, W, matrix))
    return datasets

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh: 
#         datasets = extract_arguments(fh)
#         for H, W, matrix in datasets:
#             f(H, W, matrix)