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>
long long n, m, p, P, k, phi, pri[61], top;
std::vector<long long> ans;
using namespace std;
bool vis[10000001];
template <class type_name>
inline type_name qr(type_name sample) {
  type_name ret = 0, sgn = 1;
  char cur = getchar();
  while (!isdigit(cur)) sgn = (cur == '-' ? -1 : 1), cur = getchar();
  while (isdigit(cur))
    ret = (ret << 1) + (ret << 3) + cur - '0', cur = getchar();
  return sgn == -1 ? -ret : ret;
}
long long max_factor;
inline long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
inline long long qp(long long x, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (__int128)ans * x % mod;
    x = (__int128)x * x % mod;
    p >>= 1;
  }
  return ans;
}
inline bool mr(long long x, long long b) {
  long long k = x - 1;
  while (k) {
    long long cur = qp(b, k, x);
    if (cur != 1 && cur != x - 1) return false;
    if ((k & 1) == 1 || cur == x - 1) return true;
    k >>= 1;
  }
  return true;
}
inline bool prime(long long x) {
  if (x == 46856248255981ll || x < 2) return false;
  if (x == 2 || x == 3 || x == 7 || x == 61 || x == 24251) return true;
  return mr(x, 2) && mr(x, 61);
}
inline long long f(long long x, long long c, long long n) {
  return ((__int128)x * x + c) % n;
}
inline long long PR(long long x) {
  long long s = 0, t = 0, c = 1ll * rand() % (x - 1) + 1;
  int stp = 0, goal = 1;
  long long val = 1;
  for (goal = 1;; goal <<= 1, s = t, val = 1) {
    for (stp = 1; stp <= goal; ++stp) {
      t = f(t, c, x);
      val = (__int128)val * abs(t - s) % x;
      if ((stp % 127) == 0) {
        long long d = gcd(val, x);
        if (d > 1) return d;
      }
    }
    long long d = gcd(val, x);
    if (d > 1) return d;
  }
}
inline void fac(long long x) {
  if (x <= max_factor || x < 2) return;
  if (prime(x)) {
    max_factor = max_factor > x ? max_factor : x;
    return;
  }
  long long p = x;
  while (p >= x) p = PR(x);
  while ((x % p) == 0) x /= p;
  fac(x), fac(p);
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &p);
  P = m, k = 1;
  for (int i = 59; i > 1; i--) {
    long long x = round(pow((double)m, 1.0 / (double)i));
    long long tem = 1;
    for (int j = 1; j <= i; j++) tem *= x;
    if (tem == m) {
      P = x;
      k = i;
      break;
    }
  }
  phi = (m / P) * (P - 1);
  if (gcd(m, p) > 1) {
    if (phi - 1 < n)
      puts("-1");
    else {
      for (long long i = 2, cnt = 0; i < m && cnt < n; ++i)
        if (gcd(m, i) == 1) {
          printf("%lld ", i);
          ++cnt;
        }
    }
    return 0;
  }
  if (P == 2) {
    if (m <= 10000000) {
      long long tem = 1;
      for (int i = 1; i <= m; i++, tem = (__int128)tem * p % m) vis[tem] = 1;
      for (int i = 1; i < m && (int)ans.size() < n; i++)
        if (!vis[i] && gcd(i, m) == 1) ans.push_back(i);
      if ((int)ans.size() < n)
        puts("-1");
      else
        for (int i = 0; i < (int)ans.size(); i++) printf("%lld ", ans[i]);
      return 0;
    }
    if (p % 4 == 1) {
      for (int i = 0; i < n; i++) printf("%d ", (i << 2) + 3);
      return 0;
    }
  }
  long long tem = phi;
  if (P == 2) tem >>= 1ll;
  for (long long last = -1, prod = 1; tem > 1;) {
    srand((unsigned)time(NULL));
    max_factor = 0;
    fac(tem);
    tem /= max_factor;
    if (last != max_factor) last = max_factor, prod = 1;
    pri[++top] = (prod *= last);
  }
  long long g = 2;
  if (P == 2)
    g = 5;
  else {
    for (;; g++) {
      bool cando = 1;
      for (int i = 1; i <= top; i++)
        if (qp(g, phi / pri[i], m) == 1) cando = 0;
      if (cando) break;
    }
  }
  long long v = 1;
  for (int i = 1; i <= top; i++)
    if (qp(p, phi / pri[i], m) == 1) v = (v / gcd(v, pri[i])) * pri[i];
  if ((phi / v) * (v - 1) < n)
    puts("-1");
  else {
    for (long long i = 1, cnt = 0; i < phi && cnt < n; i++)
      if (i % v) {
        printf("%lld ", qp(g, i, m));
        ++cnt;
      }
  }
  return 0;
}