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 Pr[] = {2, 3, 5, 7, 11, 13, 31};
int cc;
long long n, m, b, p, e, pr[63];
map<long long, long long> mp;
vector<long long> ans;
inline long long mul(long long a, long long b, long long m) {
  long long t =
      a * b -
      (long long)((long double)a * (long double)b / (long double)m + 0.5) * m;
  if (t >= m) t -= m;
  if (t < 0) t += m;
  return t;
}
inline long long pw(long long a, long long b, long long m) {
  long long r = 1;
  for (; b; b >>= 1, a = mul(a, a, m))
    if (b & 1) r = mul(r, a, m);
  return r;
}
inline bool MR(long long n) {
  for (int i = 0; i < 7; i++)
    if (n == Pr[i]) return 1;
  if (!(n & 1)) return 0;
  long long r = n - 1;
  int k = 0;
  while (!(r & 1)) r >>= 1, k++;
  for (int i = 0; i < 7; i++) {
    long long x = pw(Pr[i], r, n), y;
    for (int i = 0; i < k; i++, x = y) {
      y = mul(x, x, n);
      if (y == 1 && x != 1 && x != n - 1) return 0;
    }
    if (y != 1) return 0;
  }
  return 1;
}
inline long long gcd(long long a, long long b) {
  return !b ? a : gcd(b, a % b);
}
inline long long div(long long n) {
  long long x = rand() % n + 1, y = mul(x, x, n) + 1;
  long long k = 1;
  int tst = 0;
  while (x != y) {
    long long t = k;
    k = mul(k, abs(y - x), n);
    if (!k) {
      t = gcd(t, n);
      return t;
    }
    if (tst == 50) {
      tst = 0;
      t = gcd(k, n);
      if (t > 1) return t;
    }
    x = mul(x, x, n) + 1;
    y = mul(mul(y, y, n) + 1, mul(y, y, n) + 1, n) + 1;
    tst++;
  }
  long long t = gcd(k, n);
  if (t > 1) return t;
  return -1;
}
void PR(long long n) {
  if (n == 1) return;
  if (MR(n)) {
    pr[++cc] = n;
    return;
  }
  long long x;
  do x = div(n);
  while (x == -1);
  PR(x);
  PR(n / x);
}
vector<long long> fac(long long n) {
  vector<long long> V;
  V.clear();
  if (n == 1) return V;
  while (!(n & 1)) pr[++cc] = 2, n >>= 1;
  PR(n);
  for (int i = 1; i <= cc; i++) V.push_back(pr[i]);
  return V;
}
inline void facm() {
  for (long long t = 2; t * t * t <= m; t++)
    if (!(m % t)) {
      p = t;
      e = 0;
      long long v = m;
      while (v > 1) v /= p, e++;
      return;
    }
  long long t = sqrt(m);
  for (long long i = max(0ll, t - 10); i <= t + 10; i++)
    if (i * i == m) {
      p = i;
      e = 2;
      return;
    }
  p = m;
  e = 1;
}
int main() {
  scanf("%lld%lld%lld", &n, &m, &b);
  facm();
  vector<long long> F = fac(p - 1);
  for (auto t : F) mp[t]++;
  if (e > 1) mp[p] += e - 1;
  if (b % p == 0) b = 1;
  long long phi = m / p * (p - 1), ord = phi;
  for (auto t : mp)
    while (!(ord % t.first) && pw(b, ord / t.first, m) == 1) ord /= t.first;
  if (phi - ord >= n) {
    long long cnt = 0;
    while (ans.size() < n) {
      long long v = cnt++;
      if (!(v % p)) continue;
      if (pw(v, ord, m) != 1)
        ans.push_back(v);
      else if (p == 2 && e >= 3) {
        if (ord >= 2 && pw(v, ord / 2, m) == 1) {
          if (v % 8 != 1) ans.push_back(v);
        } else {
          if (v % 8 != b % 8) ans.push_back(v);
        }
      }
    }
    for (auto t : ans) printf("%lld ", t);
  } else
    puts("-1");
  return 0;
}