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 mul(long long first, long long second, long long z) {
  const int c = __builtin_clzll(z) - 1;
  const long long mask = (1LL << c) - 1;
  long long res = 0;
  if (first < second) swap(first, second);
  while (second) {
    res += first * (second & mask);
    (res >= z) && (res %= z);
    second >>= c;
    first <<= c;
    (first >= z) && (first %= z);
  }
  return res;
}
long long power(long long a, long long b, long long c, long long ans = 1) {
  for (; b; b >>= 1, a = mul(a, a, c))
    if (b & 1) ans = mul(ans, a, c);
  return ans;
}
bool witness(long long a, long long n) {
  int t = 0;
  long long u = n - 1;
  while (~u & 1LL) u >>= 1, t++;
  long long x0 = power(a, u, n), x1;
  for (int i = 0; i < t; i++) {
    x1 = mul(x0, x0, n);
    if (x1 == 1 && x0 != n - 1 && x0 != 1) return true;
    x0 = x1;
  }
  if (x0 != 1) return true;
  return false;
}
bool is_prime(long long N) {
  if (N == 1) return false;
  for (int i = 0; i < 70; i++) {
    long long a = (long long)rand() % (N - 1) + 1;
    if (witness(a, N)) return false;
  }
  return true;
}
long long add(long long first, const long long &second, const long long &z) {
  first += second;
  if (first >= z) return first - z;
  return first;
}
long long gcd(const long long &a, const long long &b) {
  if (!b) return a;
  return gcd(b, a % b);
}
inline long long pollard(long long n) {
  static mt19937_64 rnd(996);
  static const int maxt = 100;
  while (1) {
    long long first = rnd() % (n - 3) + 2, second = first, c = rnd() % n,
              tim = 0, prd = 1;
    for (long long i = 1, stp = 2;; ++i) {
      if (i == stp) second = first, stp <<= 1;
      if ((first = add(mul(first, first, n), c, n)) == second) break;
      long long tmp = prd;
      if ((prd = mul(prd, abs(second - first), n)) == 0) return gcd(tmp, n);
      if ((++tim) < maxt) continue;
      if ((prd = gcd(prd, n)) > 1) return prd;
      tim = 0;
    }
    if (tim > 0 && (prd = gcd(prd, n)) > 1) return prd;
  }
}
char ans[100000000];
int now, cur;
void print(long long first) {
  cur = now;
  while (first) ans[now++] = first % 10 + '0', first /= 10;
  reverse(ans + cur, ans + now);
  ans[now++] = ' ';
}
int main() {
  int n;
  long long m, p;
  cin >> n >> m >> p;
  long long fac = -1, deg = 0;
  for (int i = 2; i < 1e6 && fac == -1; i++)
    if (m % i == 0) fac = i;
  if (fac != -1)
    for (long long t = m; t; deg++, t /= fac)
      ;
  else {
    long long st = 1, ed = m;
    while (ed - st > 1) {
      long long md = st + ed >> 1;
      if (m / md < md)
        ed = md;
      else
        st = md;
    }
    fac = st;
    if (fac * fac != m)
      fac = m, deg = 1;
    else
      deg = 2;
  }
  long long cnt = m - m / fac;
  if (p % fac == 0) {
    cnt--;
    if (cnt < n) return puts("-1");
    for (int i = 2; n; i++)
      if (i % fac) {
        print(i);
        n--;
      }
    puts(ans);
    return 0;
  }
  long long phi = fac - 1, period = m - m / fac;
  vector<long long> v;
  if (m > fac) v.push_back(fac);
  for (int i = 2; i < 1e6; i++)
    if (phi % i == 0) {
      for (v.push_back(i); phi % i == 0; phi /= i)
        ;
    }
  if (phi < 1e12) {
    if (phi > 1) v.push_back(phi);
  } else {
    if (is_prime(phi))
      v.push_back(phi);
    else {
      long long p = pollard(phi);
      v.push_back(p);
      v.push_back(phi / p);
    }
  }
  for (long long u : v)
    while (period % u == 0 && power(p, period / u, m) == 1) period /= u;
  cnt -= period;
  if (cnt < n) return puts("-1");
  long long pr = 1;
  phi = m - m / fac;
  if (fac == 2 && m >= 8) {
    for (;; pr += 4) {
      if (power(pr, phi >> 1, m) == 1 && power(pr, phi >> 2, m) != 1) break;
    }
  } else {
    for (;; pr++) {
      bool ok = power(pr, phi, m) == 1;
      for (long long u : v) ok &= power(pr, phi / u, m) != 1;
      if (ok) break;
    }
  }
  long long stp = phi / period;
  if (fac == 2 && m >= 8 && (p & 3) == 3) {
    for (long long e = 0, u = 1, v = p; n;
         e++, u = mul(u, pr, m), v = mul(v, pr, m)) {
      if (e % stp == 0) continue;
      print(u);
      n--;
      if (n) print(v), n--;
    }
  } else {
    if (fac == 2) stp >>= 1;
    for (long long e = 0, v = 1; n; ++e, v = mul(v, pr, m)) {
      if (e % stp) print(v), n--;
      if (n && fac == 2) print(m - v), n--;
    }
  }
  puts(ans);
  return 0;
}