- Time limit: 1.00 s
- Memory limit: 512 MB
Maija and Uolevi are participating in an online contest together. One of the tasks requires string matching, which Uolevi has implemented with a rolling hash function. Uolevi's hashing function for string of length is:
is interpreted as the ASCII code of the character so .
In C++ this is:
int F(string s) { long long h = 0; for (chat c : s) h = (h * A + c) % B; return h; }
and in Python:
def F(s): h = 0 for c in s: h = (h * A + ord(c)) % B return h
Points are awarded to contestants who find failing test cases for other people's solutions so Maija immediately hacks Uolevi's solution by finding two different nonempty strings that have the same hash.
Formally, find two nonempty strings and consisting of lowercase Latin letters such that and .
Input
A single line contains two integers and .
Output
Print and in a line separated by a single space.
Constraints
Example 1
Input:
1 4
Output:
oheo yzzzeszzyc
Example 2
Input:
998244353 1000000007
Output:
yjfjdd ouiomie