#include using namespace std; int k, j, t; queue Q[4]; int main(){ cin >> k; Q[0].push(0); Q[0].push(4); Q[1].push(1); Q[2].push(2); Q[3].push(3); for(int i = 0; i < k; i++){ j = i % 4; t = Q[j].front(); Q[j].pop(); j = (j + 1) % 4; Q[j].push(t); } for(int i = 0; i < 4; i++){ while(!Q[i].empty()){ cout << char(Q[i].front() + 65); Q[i].pop(); } cout << endl; } }