#include using namespace std; int main() { int K; cin >> K; queue q0; queue q1; queue q2; queue q3; q0.push('A'); q0.push('E'); q1.push('B'); q2.push('C'); q3.push('D'); for(int i = 0; i < K; i++) { if(i % 4 == 0) { q1.push(q0.front()); q0.pop(); } else if(i % 4 == 1) { q2.push(q1.front()); q1.pop(); } else if(i % 4 == 2) { q3.push(q2.front()); q2.pop(); } else { q0.push(q3.front()); q3.pop(); } } while(!q0.empty()) { cout << q0.front(); q0.pop(); } cout << endl; while(!q1.empty()) { cout << q1.front(); q1.pop(); } cout << endl; while(!q2.empty()) { cout << q2.front(); q2.pop(); } cout << endl; while(!q3.empty()) { cout << q3.front(); q3.pop(); } cout << endl; return 0; }