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;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const long long MRP[] = {2LL,      325LL,     9375LL,      28178LL,
                         450775LL, 9780504LL, 1795265022LL};
void inc(long long &a, long long b, long long mod) {
  if ((a += b) >= mod) a -= mod;
}
long long mlt(long long a, long long b, long long mod) {
  long long ret = 0;
  while (true) {
    if (b & 1) inc(ret, a, mod);
    if ((b >>= 1) == 0) return ret;
    inc(a, a, mod);
  }
}
long long pw(long long x, long long n, long long mod) {
  long long ret = 1 % mod;
  x %= mod;
  while (true) {
    if (n & 1) ret = mlt(ret, x, mod);
    if ((n >>= 1) == 0) return ret;
    x = mlt(x, x, mod);
  }
}
bool millerrabin_isprime(long long n, long long a) {
  long long d = n - 1;
  int r = 0;
  while (d % 2 == 0) d /= 2, ++r;
  a %= n;
  if (a == 0) return true;
  long long x = pw(a, d, n);
  if (x == 1 || x == n - 1) return true;
  for (int i = (0); i < (r - 1); ++i) {
    x = mlt(x, x, n);
    if (x == 1) return false;
    if (x == n - 1) return true;
  }
  return false;
}
bool millerrabin_isprime(long long n) {
  if (n % 2 == 0) return n == 2;
  if (n <= 3) return n == 3;
  for (int i = (0); i < (7); ++i)
    if (!millerrabin_isprime(n, MRP[i])) return false;
  return true;
}
long long pollardrho(long long val) {
  if (val == 1)
    return 1;
  else if (val % 2 == 0)
    return 2;
  static mt19937_64 rnd(1237891);
  while (true) {
    long long x = rnd() % (val - 3) + 2, y = x, c = rnd() % val, d = 1;
    while (d == 1) {
      x = mlt(x, x, val);
      inc(x, c, val);
      y = mlt(y, y, val);
      inc(y, c, val);
      y = mlt(y, y, val);
      inc(y, c, val);
      d = gcd(abs(x - y), val);
    }
    if (d != val) return d;
  }
}
vector<pair<long long, int>> factorize(long long val) {
  vector<long long> factors;
  queue<long long> q;
  if (val != 1) q.push(val);
  while (!q.empty()) {
    long long cur = q.front();
    q.pop();
    if (millerrabin_isprime(cur)) {
      factors.push_back(cur);
      continue;
    }
    long long d = pollardrho(cur);
    q.push(d);
    q.push(cur / d);
  }
  sort(factors.begin(), factors.end());
  vector<pair<long long, int>> ret;
  for (int l = 0, r = l; l < ((int)(factors).size()); l = r) {
    while (r < ((int)(factors).size()) && factors[r] == factors[l]) ++r;
    ret.push_back(make_pair(factors[l], r - l));
  }
  return ret;
}
const int MAXNEED = 500000;
int need;
long long mod, forbidden;
long long ans[MAXNEED];
int nans;
long long p;
int k;
long long phi;
vector<pair<long long, int>> phifactors;
long long forbiddenorder;
long long gen, genord;
long long safemlt(long long a, long long b) {
  assert(a >= 1 && b >= 1);
  return a > LLONG_MAX / b ? LLONG_MAX : a * b;
}
long long safepw(long long x, int n) {
  long long ret = 1;
  while (true) {
    if (n & 1) ret = safemlt(ret, x);
    if ((n >>= 1) == 0) return ret;
    x = safemlt(x, x);
  }
}
void calcpk() {
  p = mod;
  k = 1;
  for (int i = 2;; ++i) {
    if (safepw(2, i) > mod) break;
    long long l = 2, r = 4;
    while (safepw(r, i) <= mod) l = r, r += r;
    while (l + 1 < r) {
      long long m = l + (r - l) / 2;
      if (safepw(m, i) <= mod)
        l = m;
      else
        r = m;
    }
    if (safepw(l, i) == mod) p = l, k = i;
  }
}
void calcforbiddenorder() {
  phi = p - 1;
  for (int i = (0); i < (k - 1); ++i) phi *= p;
  phifactors = factorize(phi);
  if (gcd(mod, forbidden) == 1) {
    forbiddenorder = phi;
    for (int i = (0); i < (((int)(phifactors).size())); ++i) {
      long long pp = phifactors[i].first;
      for (int j = (0); j < (phifactors[i].second); ++j) forbiddenorder /= pp;
      long long cur = pw(forbidden, forbiddenorder, mod);
      while (cur != 1) cur = pw(cur, pp, mod), forbiddenorder *= pp;
    }
  } else {
    forbiddenorder = -1;
  }
}
void calcgen() {
  if (p == 2) {
    genord = phi / 2;
    if (k == 1)
      gen = 1;
    else if (k == 2)
      gen = 3;
    else
      gen = 5;
  } else {
    genord = phi;
    for (gen = 2;; ++gen) {
      assert(gen < mod);
      bool ok = true;
      for (int i = (0); i < (((int)(phifactors).size())); ++i)
        if (pw(gen, phi / phifactors[i].first, mod) == 1) {
          ok = false;
          break;
        }
      if (ok) break;
    }
  }
}
bool solve() {
  calcpk();
  calcforbiddenorder();
  long long have = phi - (forbiddenorder == -1 ? 1 : forbiddenorder);
  if (have < need) return false;
  nans = 0;
  if (forbiddenorder == -1) {
    for (long long i = 2; nans < need && i < mod; ++i)
      if (i % p != 0) ans[nans++] = i;
  } else {
    calcgen();
    if (genord != phi && forbidden % 4 == 3) {
      for (long long aval = 1, bval = forbidden, exp = 0;
           exp < genord && nans < need;
           aval = mlt(aval, gen, mod), bval = mlt(bval, gen, mod), ++exp) {
        if (nans < need && exp % (2 * genord / forbiddenorder) != 0)
          ans[nans++] = aval;
        if (nans < need && exp % (2 * genord / forbiddenorder) != 0)
          ans[nans++] = bval;
      }
    } else {
      for (long long val = 1, exp = 0; exp < genord && nans < need;
           val = mlt(val, gen, mod), ++exp) {
        if (nans < need && exp % (genord / forbiddenorder) != 0)
          ans[nans++] = val;
        if (nans < need && genord != phi) ans[nans++] = mod - val;
      }
    }
  }
  assert(nans == need);
  return true;
}
void run() {
  scanf("%d%lld%lld", &need, &mod, &forbidden);
  if (!solve()) {
    printf("-1\n");
    return;
  }
  for (int i = (0); i < (need); ++i) {
    if (i != 0) printf(" ");
    printf("%lld", ans[i]);
  }
  puts("");
}
int main() {
  run();
  return 0;
}