Nastia And A Hidden Permutation

hard
https://codeforces.com/problemset/problem/1521/C

Input Format

Check the link

Output Format

Check the link

Constraints

Check the link

Example

Input

        
Output

        
Previous
Take A Guess
Next
Rocket

Related Questions