L. Unequal
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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:

  • $$$a_{i-1}\cdot a_i\bmod p \ne a_i\cdot a_{i+1}\bmod p$$$.

If such a permutation exists, output any valid permutation; otherwise, output $$$-1$$$.

Input

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.

Output

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$$$.

Examples
Input
3 2
Output
2 1 3
Input
6 2
Output
-1
Note

In this problem, $$$a \bmod p$$$ refers to taking the remainder of $$$a$$$ after division by $$$p$$$. For example:

  • $$$11 \bmod 5 = 1$$$ ($$$11 = 5\times 2 + 1$$$);
  • $$$7 \bmod 5 = 2$$$ ($$$7 = 5\times 1 + 2$$$);
  • $$$3 \bmod 5 = 3$$$ ($$$3$$$ is already smaller than $$$5$$$).