Max is a magician whose job is to shuffle magic cards and confuse innocent bystanders. He uses a special deck with
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
Afterwards, Max asks you
Input Specification
The first line will contain
The second line will contain
The next
Output Specification
For each question, output the
Scoring
At least 50% of the test cases will have
Sample Input
3
6
5
4
3
2
1
0
Sample Output
3 2 1
3 1 2
2 3 1
2 1 3
1 3 2
1 2 3
Comments