def find_first_undefined_cell(grid):
    """Returns the r,c of the first undefined cell"""
    for x,row in enumerate(grid):
        for y,vy in enumerate(row):
            if vy < 0:
                return x, y
    return -1, -1