def extract_arguments(fh):
    test_cases = []
    while True:
        line = fh.readline().strip()
        if line == "0 0 0":
            break
        N, M, L = map(int, line.split())
        grid = []
        for _ in range(2 * N - 1):
            row = list(map(int, fh.readline().strip().split()))
            grid.append(row)
        test_cases.append((N, M, L, grid))
    return test_cases

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh: 
#     test_cases = extract_arguments(fh)
#     for test_case in test_cases:
#         f(*test_case)