Problem:
Score : 700 points

Problem Statement

For strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.

Let L be a positive integer. A set of strings S is a good string set when the following conditions hold true:

Each string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.

Any two distinct strings in S are prefix-free.

We have a good string set S = \{ s_1, s_2, ..., s_N \}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:

Add a new string to S. After addition, S must still be a good string set.

The first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.

Constraints

1 \leq N \leq 10^5

1 \leq L \leq 10^{18}

s_1, s_2, ..., s_N are all distinct.

{ s_1, s_2, ..., s_N } is a good string set.

|s_1| + |s_2| + ... + |s_N| \leq 10^5

Input

Input is given from Standard Input in the following format:

N L
s_1
s_2
:
s_N

Output

If Alice will win, print Alice; if Bob will win, print Bob.

Sample Input 1

2 2
00
01

Sample Output 1

Alice

If Alice adds 1, Bob will be unable to add a new string.

Sample Input 2

2 2
00
11

Sample Output 2

Bob

There are two strings that Alice can add on the first turn: 01 and 10.
In case she adds 01, if Bob add 10, she will be unable to add a new string.
Also, in case she adds 10, if Bob add 01, she will be unable to add a new string.

Sample Input 3

3 3
0
10
110

Sample Output 3

Alice

If Alice adds 111, Bob will be unable to add a new string.

Sample Input 4

2 1
0
1

Sample Output 4

Bob

Alice is unable to add a new string on the first turn.

Sample Input 5

1 2
11

Sample Output 5

Alice

Sample Input 6

2 3
101
11

Sample Output 6

Bob

Solution in Rust (1.15.1) (judge verdict: Accepted)

fn getline() -> String {
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).ok();
    res
}

#[allow(unused_macros)]
macro_rules! readl {
    ($t: ty) => {
        {
            let s = getline();
            s.trim().parse::<$t>().unwrap()
        }
    };
    ($( $t: ty),+ ) => {
        {
            let s = getline();
            let mut iter = s.trim().split(' ');
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
}

#[allow(unused_macros)]
macro_rules! readlvec {
    ($t: ty) => {
        {
            let s = getline();
            let iter = s.trim().split(' ');
            iter.map(|x| x.parse().unwrap()).collect::<Vec<$t>>()
        }
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn printiter<'a, T>(v: &'a T)
where
    &'a T: std::iter::IntoIterator,
    <&'a T as std::iter::IntoIterator>::Item: std::fmt::Display,
{
    for (i, e) in v.into_iter().enumerate() {
        if i != 0 {
            print!(" ");
        }
        print!("{}", e);
    }
    println!("");
}

enum BinaryTrie {
    Node(Box<BinaryTrie>, Box<BinaryTrie>, bool),
    Empty,
}

impl BinaryTrie {
    fn new() -> Self {
        BinaryTrie::Empty
    }

    fn add<'a, T: Iterator<Item = bool>>(&mut self, mut iter: T) {
        use BinaryTrie::*;
        match iter.next() {
            Some(true) => match self {
                &mut Node(_, ref mut right, _) => {
                    right.add(iter);
                }
                &mut Empty => {
                    let mut r = Box::new(Empty);
                    r.add(iter);
                    *self = Node(Box::new(Empty), r, false);
                }
            },
            Some(false) => match self {
                &mut Node(ref mut left, _, _) => {
                    left.add(iter);
                }
                &mut Empty => {
                    let mut l = Box::new(Empty);
                    l.add(iter);
                    *self = Node(l, Box::new(Empty), false);
                }
            },
            None => match self {
                &mut Node(_, _, ref mut f) => *f = true,
                &mut Empty => *self = Node(Box::new(Empty), Box::new(Empty), true),
            },
        }
    }

    fn contain<T: Iterator<Item = bool>>(&mut self, mut iter: T) -> bool {
        use BinaryTrie::*;
        match iter.next() {
            Some(true) => match self {
                &mut Node(_, ref mut right, _) => right.contain(iter),
                &mut Empty => false,
            },
            Some(false) => match self {
                &mut Node(ref mut left, _, _) => left.contain(iter),
                &mut Empty => false,
            },
            None => match self {
                &mut Node(_, _, is_end) => is_end,
                &mut Empty => false,
            },
        }
    }

    fn solve(&self) -> Vec<usize> {
        let mut res = Vec::new();
        self.rec(0, &mut res);
        res
    }

    fn rec(&self, depth: usize, v: &mut Vec<usize>) {
        use BinaryTrie::*;
        match self {
            &Node(ref left, ref right, false) => {
                left.rec(depth + 1, v);
                right.rec(depth + 1, v);
            },
            &Empty => {
                v.push(depth);
            }
            _ => (),
        }
    }
}

fn naive_grundy(n: usize) -> usize {
    let mut dp = vec![0; n + 1];
    for i in 1..n + 1 {
        let mut mex = vec![false; 2*n + 1];
        mex[0] = true;
        let mut xor = 0;
        for j in (0..i).rev() {
            xor ^= dp[j];
            mex[xor] = true;
        }
        dp[i] = mex.iter().cloned().position(|x| !x).unwrap();
    }
    debug!(dp);
    dp.pop().unwrap()
}

fn get_grundy(n: usize) -> usize {
    if n == 0 {
        0
    } else {
        let mut i = 1;
        while n%(i*2) != i {
            i *= 2;
        }
        i
    }
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BinaryHeap, HashMap, HashSet};
#[allow(unused_imports)]
use std::collections::btree_map::Entry::{Occupied, Vacant};

fn main() {
    use std::io::Write;
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    macro_rules! printf { ($($arg:tt)*) => (write!(out, $($arg)*).unwrap()); }
    macro_rules! printfln { () => (writeln!(out).unwrap()); ($($arg:tt)*) => (writeln!(out, $($arg)*).unwrap()); }
    // naive_grundy(100);
    // debug!((0..100).map(|x| get_grundy(x)).collect::<Vec<_>>());

    let (n, l) = readl!(usize, usize);
    let s: Vec<Vec<_>> = (0..n)
        .map(|_| {
            readl!(String)
                .into_bytes()
                .into_iter()
                .map(|c| c == b'1')
                .collect()
        })
        .collect();
    let mut trie = BinaryTrie::new();
    for e in &s {
        trie.add(e.iter().cloned());
    }

    
    let grundy = trie.solve()
        .into_iter()
        .map(|x|{
            // debug!(l-x+1);
            let t = get_grundy(l - x + 1);
            // debug!(t);
            t
        })
        .fold(0, |sum, e| sum ^ e);

    if grundy == 0 {
        printfln!("Bob");
    } else {
        printfln!("Alice");
    }
}