Problem: Tokitsukaze is playing a room escape game designed by SkywalkerT. In this game, she needs to find out hidden clues in the room to reveal a way to escape.

After a while, she realizes that the only way to run away is to open the digital door lock since she accidentally went into a secret compartment and found some clues, which can be interpreted as:

  * Only when you enter n possible different passwords can you open the door; 
  * Passwords must be integers ranged from 0 to (m - 1); 
  * A password cannot be x (0 ≤ x < m) if x and m are not coprime (i.e. x and m have some common divisor greater than 1); 
  * A password cannot be x (0 ≤ x < m) if there exist non-negative integers e and k such that p^e = k m + x, where p is a secret integer; 
  * Any integer that doesn't break the above rules can be a password; 
  * Several integers are hidden in the room, but only one of them can be p. 



Fortunately, she finds that n and m are recorded in the lock. However, what makes Tokitsukaze frustrated is that she doesn't do well in math. Now that she has found an integer that is suspected to be p, she wants you to help her find out n possible passwords, or determine the integer cannot be p.

Input

The only line contains three integers n, m and p (1 ≤ n ≤ 5 × 10^5, 1 ≤ p < m ≤ 10^{18}).

It is guaranteed that m is a positive integer power of a single prime number.

Output

If the number of possible different passwords is less than n, print a single integer -1.

Otherwise, print n distinct integers ranged from 0 to (m - 1) as passwords. You can print these integers in any order. Besides, if there are multiple solutions, print any.

Examples

Input


1 2 1


Output


-1


Input


3 5 1


Output


2 4 3


Input


2 5 4


Output


2 3


Input


4 9 8


Output


2 4 7 5

Note

In the first example, there is no possible password.

In each of the last three examples, the given integer n equals to the number of possible different passwords for the given integers m and p, so if the order of numbers in the output is ignored, the solution is unique as shown above.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n;
long long mod, p;
long long q, phi;
int al;
map<long long, bool> mp;
long long big_rand(long long m) { return 1ll * rand() * rand() % m; }
long long multi(long long x, long long y, long long m, int d = 1) {
  if (!x || !y) return 0;
  return (((x & ((1ll << d) - 1)) * y) % m +
          (multi(x >> d, y, m, d) << d) % m) %
         m;
}
long long modmul(long long x, long long y, long long m) {
  int d = 63 - __builtin_clzll(m) + 1;
  return d <= 31 ? x * y % m : multi(x, y, m, 63 - d);
}
long long powmod(long long x, long long y, long long m) {
  long long rlt = 1;
  while (y) {
    if (y & 1) rlt = modmul(rlt, x, m);
    x = modmul(x, x, m), y >>= 1;
  }
  return rlt;
}
bool Miller_Rabbin(long long n) {
  if (n == 2) return 1;
  if (n < 2 || !(n & 1)) return 0;
  int k = __builtin_ctzll(n - 1);
  long long m = n >> k;
  int step = 7;
  for (int i = 0, j; i < step; i++) {
    long long x = big_rand(n - 2) + 2;
    x = powmod(x, m, n);
    if (x == 1) continue;
    for (j = 0; j < k; j++) {
      if (x == n - 1) break;
      x = modmul(x, x, n);
    }
    if (j >= k) return 0;
  }
  return 1;
}
long long gcd(long long x, long long y) {
  while (y) {
    long long z = x % y;
    x = y, y = z;
  }
  return x;
}
long long func(long long x, long long m) { return (modmul(x, x, m) + 1) % m; }
long long Pollard(long long n) {
  if (Miller_Rabbin(n)) return n;
  if (!(n & 1)) return 2;
  for (long long i = 1;; i++) {
    long long x = i, y = func(x, n), rlt = gcd(y - x, n);
    while (rlt == 1) {
      x = func(x, n);
      y = func(func(y, n), n);
      rlt = gcd((y - x + n) % n, n) % n;
    }
    if (rlt > 0 && rlt < n) return rlt;
  }
}
vector<long long> pf;
void go(long long x) {
  long long y = Pollard(x);
  if (y == x) {
    pf.push_back(y);
    return;
  }
  go(y), go(x / y);
}
long long a[33];
int b[33], cnt;
vector<long long> ddd;
void prime_factorization(long long m) {
  pf.clear();
  go(m);
  sort(pf.begin(), pf.end());
  cnt = 0;
  for (int i = 0; i < pf.size(); i++) {
    if (!i || pf[i] != pf[i - 1])
      a[++cnt] = pf[i], b[cnt] = 1;
    else
      b[cnt]++;
  }
}
bool check(long long x, long long y, long long p) {
  if (x == 1) return 0;
  while (1) {
    if (powmod(x, y, mod) != 1) return 1;
    if (y == 1) return 0;
    long long lst;
    while (y > 1 && powmod(x, y, mod) == 1)
      y >>= 1, lst = p, p = modmul(p, p, mod);
    x = modmul(x, lst, mod);
  }
  return 0;
}
int main() {
  scanf("%d %I64d %I64d", &n, &mod, &p);
  for (q = 2; q <= 1000000; q++)
    if (mod % q == 0) break;
  if (q <= 1000000) {
    al = 0;
    long long x = mod;
    while (x % q == 0) x /= q, al++;
  } else {
    q = sqrt(mod) - 5;
    while (q * q < mod) q++;
    if (q * q == mod)
      al = 2;
    else
      q = mod, al = 1;
  }
  phi = mod / q * (q - 1);
  if (p % q == 0) {
    if (phi - 1 < n)
      puts("-1");
    else {
      long long x = 2;
      while (n--) {
        if (x % q == 0) x++;
        printf("%I64d ", x);
        x++;
      }
    }
    return 0;
  }
  long long y = 1;
  if (q > 2) prime_factorization(q - 1);
  if (al > 1) a[++cnt] = q, b[cnt] = al - 1;
  ddd.push_back(1);
  for (int i = 1; i <= cnt; i++) {
    for (int j = ddd.size() - 1; j >= 0; j--) {
      long long x = ddd[j];
      for (int k = 0; k < b[i]; k++) {
        x *= a[i];
        ddd.push_back(x);
      }
    }
  }
  int sz = ddd.size();
  sort(ddd.begin(), ddd.end());
  for (int i = 0; i < sz; i++) {
    if (powmod(p, ddd[i], mod) == 1) {
      y = ddd[i];
      break;
    }
  }
  if (phi - y < n) return puts("-1"), 0;
  if (y < 500000) {
    long long k = 1;
    for (int i = 0; i < y; i++) mp[k] = 1, k = modmul(k, p, mod);
    assert(k == 1), k = 1;
    while (n--) {
      while (k % q == 0 || mp[k]) k++;
      printf("%I64d ", k);
      k++;
    }
    return 0;
  }
  long long rt = 2;
  if (q != 2) {
    while (rt % q == 0 || powmod(rt, y, mod) == 1) rt++;
  } else {
    while (rt % q == 0 || !check(rt, y, p)) rt++;
  }
  for (int i = 0; i < n; i++) printf("%I64d ", rt), rt = modmul(rt, p, mod);
  return 0;
}