use std::collections::BTreeSet; fn solve(scanner: &mut Scanner) { let n: usize = scanner.next(); let mut set = BTreeSet::::new(); for _ in 0..n { let s: Vec = scanner.next::().chars().collect(); let mut a = 0; for i in 0..(n.min(15)) { a <<= 1; if s[i] == 'b' { a += 1; } } set.insert(a); } for a in 0..=1010 { if set.contains(&a) { continue; } let mut ans: Vec = vec![]; let mut a = a; for _ in 0..(n.min(15)) { if (a & 1) == 1 { ans.push('b'); } else { ans.push('a'); } a >>= 1; } ans.reverse(); for _ in (n.min(15))..n { ans.push('a'); } let ans: String = ans .iter() .map(|a| a.to_string()) .collect::>() .join(""); println!("{}", ans); return; } } fn main() { let mut scanner = Scanner::new(); let t: usize = 1; for _ in 0..t { solve(&mut scanner); } } struct Scanner { buf: Vec, } impl Scanner { fn new() -> Self { Self { buf: vec![] } } fn next(&mut self) -> T { loop { if let Some(x) = self.buf.pop() { return x.parse().ok().expect(""); } let mut source = String::new(); std::io::stdin().read_line(&mut source).expect(""); self.buf = Self::split(source); } } fn split(source: String) -> Vec { source .split_whitespace() .rev() .map(String::from) .collect::>() } }