def extract_arguments(fh):
    N, M = map(int, fh.readline().strip().split())
    grid = []
    for _ in range(N):
        row = list(map(int, fh.readline().strip().split()))
        grid.append(row)
    return N, M, grid