#include #include using namespace std; using namespace atcoder; typedef int64_t lint; #define rep(i, n) for(int i=0; i; using vvi = vector>; template inline void vin(vector& v) { rep(i, v.size()) cin >> v.at(i); } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template inline void drop(T x) { cout << x << endl; exit(0); } template void vout(vector v) { rep(i, v.size()) { cout << v.at(i) << ' '; } cout << endl; } constexpr lint LINF = LLONG_MAX/2; int main() { lint N; cin >> N; lint a=0, b=0, c=0, x, y, z; queue q0, q1, q2, q3; q0.push('A'); q1.push('B'); q2.push('C'); q3.push('D'); q0.push('E'); rep(i, N) { if (i%4 == 0) { q1.push(q0.front()); q0.pop(); } if (i%4 == 1) { q2.push(q1.front()); q1.pop(); } if (i%4 == 2) { q3.push(q2.front()); q2.pop(); } if (i%4 == 3) { q0.push(q3.front()); q3.pop(); } } rep(_, 4) { while (!q0.empty()) { std::cout << q0.front(); q0.pop(); } std::cout << '\n'; swap(q0, q1); swap(q1, q2); swap(q2, q3); } }