use std::collections::VecDeque; fn main() { let k: usize = input_a_value(); let mut q = Vec::new(); q.push(VecDeque::from(vec!['A', 'E'])); q.push(VecDeque::from(vec!['B'])); q.push(VecDeque::from(vec!['C'])); q.push(VecDeque::from(vec!['D'])); for i in 0..k { let ch = q[i % 4].pop_front().unwrap(); q[(i + 1) % 4].push_back(ch); } for s in q { println!( "{}", s.into_iter() .map(|x| x.to_string()) .collect::>() .join("") ); } } #[allow(unused)] fn input_a_value() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() }