You are given two integers $$$n$$$ and $$$p$$$, where $$$p$$$ is a prime number.
Find a permutation $$$a_1,a_2,\dots,a_n$$$ of the integers from $$$1$$$ to $$$n$$$ (each number appears exactly once), such that for every index $$$i$$$ with $$$2\le i\le n-1$$$, the following holds:
If such a permutation exists, output any valid permutation; otherwise, output $$$-1$$$.
A single line with two integers $$$n$$$ and $$$p$$$ ($$$2\le p\le n\le 2\cdot10^{5}$$$, $$$p$$$ is prime), separated by a space.
If a valid permutation exists, output $$$n$$$ integers: the permutation $$$a_1\;a_2\;\dots\;a_n$$$ (space-separated) on one line. Otherwise, output a single line containing $$$-1$$$.
3 2
2 1 3
6 2
-1
In this problem, $$$a \bmod p$$$ refers to taking the remainder of $$$a$$$ after division by $$$p$$$. For example: