use std::collections::BTreeMap; #[allow(unused_macros)] pub mod input { macro_rules! value { ($iter:expr, ($($type: tt),*)) => { ($(input::value!($iter, $type)),*); }; ($iter: expr, [$type: tt; $len: expr]) => { (0..$len).map(|_| input::value!($iter, $type)).collect::>() }; ($iter: expr, Chars) => { input::value!($iter, String).chars().collect::>>() }; ($iter: expr, $type: ty) => { if let Some(v) = $iter.next() { v.parse::<$type>().ok() } else { None } }; } macro_rules! expand { ($iter: expr,) => {}; ($iter: expr, mut $var: ident : $type: tt, $($xs: tt)*) => { let mut $var = value!($iter, $type); input::expand!($iter, $($xs)*); }; ($iter: expr, $var: ident : $type: tt, $($xs: tt)*) => { let $var = input::value!($iter, $type); input::expand!($iter, $($xs)*); }; } macro_rules! read_line { ($($xs: tt)*) => { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); let mut iter = buf.split_whitespace(); input::expand!(iter, $($xs)*); }; } #[allow(unused_imports)] pub(super) use {expand, read_line, value}; } pub fn integer_factorization(mut n: usize) -> BTreeMap { let mut map = BTreeMap::new(); let mut i = 2; while i * i <= n { while n % i == 0 { *map.entry(i).or_insert(0) += 1; n /= i; } i += 1; } if n != 0 && n != 1 { *map.entry(n).or_insert(0) += 1; } map } fn main() { input::read_line! { n: usize, } let n = n.unwrap(); input::read_line! { m: [usize; n], } let g = m .into_iter() .map(|x| x.unwrap()) .map(|x| integer_factorization(x)) .flatten() .map(|pe| pe.1 % 3) .fold(0, |x, y| x ^ y); println!("{}", if g != 0 { "Alice" } else { "Bob" }); }