use std::collections::VecDeque; fn main() { let k: usize = input_a_value(); let mut q = Vec::new(); q.push(VecDeque::from(['A', 'E'])); q.push(VecDeque::from(['B'])); q.push(VecDeque::from(['C'])); q.push(VecDeque::from(['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() }