def find_empty(grid):
    """
    Find an empty square in the grid and returns its position, if no empty squares are found return None
    """
    for i in range(9):
        for j in range(9):
            if grid[i][j] == 0:
                return i, j

    return None