Given an integer , find the lexicographically smallest permutation of such that is prime for all , or report that no such permutation exists.
Subtask 1 [5%]
Subtask 2 [25%]
Subtask 3 [15%]
Subtask 4 [30%]
Subtask 5 [25%]
No additional constraints.
The first and only line of input contains a single integer .
If no such permutation exists, output on a line by itself. Otherwise, output space-separated integers , the lexicographically smallest permutation such that is prime for all .
1 3 2
Note that , , and are all prime.