#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); ll x, y; cin >> x >> y; map mp; for (int a = 'a'; a <= 'z'; ++a) { for (int b = 'a'; b <= 'z'; ++b) { for (int c = 'a'; c <= 'z'; ++c) { for (int d = 'a'; d <= 'z'; ++d) { string s = { char(a), char(b), char(c), char(d) }; ull hash = (a + x * b + x * x * c + x * x * x * d) % y; if (mp.contains(hash)) { cout << s << '\n' << mp[hash] << '\n'; return 0; } mp[hash] = s; } } } } assert(false); return 0; }