#![allow(non_snake_case)] use std::io::{ self, prelude::* }; use std::process; macro_rules! pick { ($tokens:expr) => { $tokens.next().unwrap().parse().expect("parse error") } } fn win_a() -> ! { println!("A"); process::exit(0); } fn win_b() -> ! { println!("B"); process::exit(0); } fn main() { let mut s = String::new(); io::stdin().read_to_string(&mut s).expect("i/o error"); let mut tokens = s.split_whitespace(); let N: usize = pick!(tokens); let A: Vec = (0..N).map(|_| pick!(tokens)).collect(); let s = A.iter().sum::(); if s == 0 { win_b(); } if s == 1 { win_a(); } for i in 0..N { if A[i] == 0 { continue; } let mut v = A.clone(); v[i] -= 1; let count_one = v.iter().filter(|&&e| e == 1).count() as u64; if count_one == s-1 && count_one % 2 == 0 { win_a(); } } win_b(); }