Fuad’s challenge
With the launch of the “Technest” Scholarship Program in 2023 at the International Olympiad training camp, after hard trainings Fuad and Aykhan are playing a permutation puzzle game. Fuad challenges Aykhan to create a special sequence of numbers.
To win the challenge, Aykhan must generate a “composite sum permutation”, a sequence where for every between and inclusive, the sum of the first numbers of the permutation of size is always composite.
A positive integer is considered composite if it has more than two positive integer divisors. For instance, integers like , and are composite, while , and are not.
A sequence of positive integers is defined as a permutation of length if it contains every integer between and inclusive exactly once.
We’ll call a permutation a “composite sum permutation” if, for every index between and inclusive, the sum of the first elements of , denoted as , is a composite number.
Help Aykhan to generate the required permutation by writing a program.
Input
One single integer .
Output
If no composite sum permutation of length exists, print a single integer .
Otherwise, print integers such that is a “composite sum permutation”.
If there are multiple composite sum permutations of length , you may print any of them.
Examples
In the first example for , there is no answer.
In the second example for , we can generate permutation “”. Compute the prefix sums: “”. Each of these sums is composite: ".
Scoring
This task consists of the following subtasks. If all tests of a subtask are passed, you will earn points for that subtask.
( points): ;
( points): ;