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;
const int maxn = 500005;
inline long long qmul(long long x, long long y, long long mod) {
  long long ans =
      (x * y - (long long)((long double)x / mod * y) * mod + mod) % mod;
  if (ans < 0) ans += mod;
  return ans;
}
long long qpow(long long a, long long b, long long p) {
  long long res = 1;
  while (b) {
    if (b & 1) res = qmul(res, a, p);
    a = qmul(a, a, p);
    b >>= 1;
  }
  return res;
}
bool miller_Rabin(long long n) {
  if (n == 2) return true;
  int s = 20, i, t = 0;
  long long u = n - 1;
  while (!(u & 1)) {
    t++;
    u >>= 1;
  }
  while (s--) {
    long long a = rand() % (n - 2) + 2;
    long long x = qpow(a, u, n);
    long long y = 0;
    for (int j = 0; j < t; j++) {
      y = qmul(x, x, n);
      if (y == 1 && x != 1 && x != n - 1) return false;
      x = y;
    }
    if (y != 1) return false;
  }
  return true;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long pollard_Rho(long long n, int c) {
  long long i = 1, k = 2, x = rand() % (n - 1) + 1, y = x;
  while (true) {
    i++;
    x = (qmul(x, x, n) + c) % n;
    long long p = gcd((y - x + n) % n, n);
    if (p != 1 && p != n) return p;
    if (y == x) return n;
    if (i == k) {
      y = x;
      k <<= 1;
    }
  }
}
vector<long long> res;
void Fnd(long long n, int c) {
  if (n == 1) return;
  if (miller_Rabin(n)) {
    res.push_back(n);
    return;
  }
  long long p = n, k = c;
  while (p >= n) p = pollard_Rho(p, c--);
  Fnd(p, k);
  Fnd(n / p, k);
}
int n;
long long m, p;
long long pr[maxn], ps[maxn];
int cnt = 0;
int tot = 0;
long long phi;
long long dfs(int a, long long b) {
  if (a == cnt + 1) {
    if (qpow(p, b, m) == 1) return b;
    return -1;
  }
  long long np = 1;
  for (int j = 0; j <= ps[a]; j++) {
    long long nr = dfs(a + 1, b * np);
    if (nr != -1) return nr;
    np = np * pr[a];
  }
  return -1;
}
long long ans[maxn], ncnt = 0;
int fl[maxn * 20];
int main() {
  cin >> n >> m >> p;
  Fnd(m, 107);
  long long np = res[0];
  res.clear();
  phi = m / np * (np - 1);
  Fnd(phi, 107);
  sort(res.begin(), res.end());
  if (!(p % np)) {
    for (int j = 1; j <= m; j++)
      if ((j == 1) || (!(j % np)))
        continue;
      else {
        ans[ncnt++] = j;
        if (ncnt >= n) break;
      }
    if (ncnt >= n)
      for (int i = 0; i < ncnt; i++) cout << ans[i] << " ";
    else
      cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < res.size(); i++) {
    if (i == 0 || res[i] != res[i - 1]) cnt++, pr[cnt] = res[i], ps[cnt] = 0;
    ps[cnt]++;
  }
  long long u = dfs(1, 1);
  long long dv = phi - u;
  if (dv < n)
    cout << -1 << endl;
  else {
    const int mxs = 2100000;
    for (int j = 1; j <= mxs && j <= m; j++) {
      if (!(j % np)) continue;
      if (qpow(j, u, m) == 1) continue;
      ans[ncnt++] = j;
      if (ncnt >= n) break;
    }
    if (ncnt < n) {
      ncnt = 0;
      if (u <= mxs * 2) {
        int nr = 1;
        for (int j = 0; j < u; j++) fl[nr] = 1, nr = 1ll * nr * p % m;
        for (int j = 1; j <= m; j++)
          if (!(j % 2))
            continue;
          else {
            if (fl[j]) continue;
            ans[ncnt++] = j;
            if (ncnt >= n) break;
          }
      } else {
        long long dv = m - 1;
        for (int j = 0; j < u; j++) {
          ans[ncnt++] = dv, dv = qmul(dv, p, m);
          if (ncnt >= n) break;
        }
      }
    }
    for (int j = 0; j < ncnt; j++) printf("%lld ", ans[j]);
  }
  return 0;
}