409662: GYM103671 C End Time
Description
This is an interactive problem. You have to use a flush operation right after printing each line. For example, in C++ you should use the function fflush(stdout), in Java — System.out.flush(), in Pascal — flush(output) and in Python — sys.stdout.flush().
Definitions
A permutation of length $$$n$$$ is a sequence of $$$n$$$ integers between $$$1$$$ and $$$n$$$ inclusive, such that each number appears exactly once.
When a string $$$s$$$ gets shifted, all characters except the last move to the right by one position. The last character moves to the beginning. For example, the string "End Time" can be shifted to read "eEnd Tim".
Let $$$\Sigma = \{a, b, ..., z, A, B, ..., Z\}$$$, in other words the set of lowercase and uppercase characters from the English alphabet. When a character $$$c$$$ in $$$\Sigma - \{z, Z\}$$$ gets shifted, it becomes the alphabetically next character of the same case. In particular, $$$z$$$ gets shifted to $$$A$$$, and $$$Z$$$ gets shifted to $$$a$$$.
Problem Statement
It is a sunny, but humid day as your time comes to an end. You are given a single integer $$$n$$$ $$$(1 \leq n \leq 100)$$$. Your last words are a sequence of $$$26n$$$ messages $$$m_1, m_2, ..., m_{26n}$$$, each of which is a string of length $$$26n$$$ consisting only of characters from $$$\Sigma$$$.
However, your last words have been misinterpreted, and the following transformation has occurred! A permutation $$$p$$$ of length $$$26n$$$ is picked. The $$$i$$$th message becomes the $$$p_i$$$th message. Afterwards, for each message $$$m_i$$$, two integers $$$a_i$$$ and $$$b_i$$$ are chosen from the range $$$[0, 52n - 1]$$$, inclusive. $$$m_i$$$ first gets shifted $$$a_i$$$ times. Then, for all $$$j$$$, the $$$j$$$th character of $$$m_i$$$ gets shifted $$$b_i(j - 1)$$$ times.
You see what your last words have been misinterpreted as. With your consciousness slowly fading, you are determined to figure out the permutation $$$p$$$.
InteractionYour program is given a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$).
After reading in the integer, your program should output $$$26n$$$ lines, the $$$i$$$th line consisting of the message $$$m_i$$$. It must be true that each $$$m_i$$$ contains exactly $$$26n$$$ characters, and each character is a lowercase or uppercase letter.
The judge program will then respond with the $$$26n$$$ transformed strings, each of which is on a separate line.
Finally, your program should output $$$26n$$$ space-separated integers on a single line. The $$$i$$$th integer is what your program thinks $$$p_i$$$ is.
In order to pass a test case, the guessed permutation must be exactly correct, even if multiple permutations are possible.
ExampleInput1 acegikmoqsuwyACEGIKMOQSUWY xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxENDxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxTIMExxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxOutput
aaaaaaaaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxENDxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxTIMExxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26Note
The choices for $$$a_1$$$ and $$$b_1$$$ for the first message are $$$20$$$ and $$$2$$$, respectively. Miraculously, the chosen permutation was the identity, and for all other lines, $$$a_i$$$ and $$$b_i$$$ were chosen to both be $$$0$$$.