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;
set<long long> S;
inline long long mul_mod(long long a, long long b, long long c) {
  long long t = a * b - (long long)((long double)a * b / c + 0.5) * c;
  t += t >> 63 & c;
  return t;
}
long long ksm(long long a, long long b, long long mod, long long c = 1) {
  for (; b; b /= 2, a = mul_mod(a, a, mod))
    if (b & 1) c = mul_mod(c, a, mod);
  return c;
}
namespace PR {
const int prs = 12;
const int Test[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
bool Witness(long long a, long long n) {
  int t = 0;
  long long u = n - 1;
  while (!(u & 1)) u >>= 1, ++t;
  long long d = ksm(a, u, n);
  for (int i = 0; i < t; ++i) {
    long long e = mul_mod(d, d, n);
    if (e == 1 && d != n - 1 && d != 1) return 1;
    d = e;
  }
  if (d != 1) return 1;
  return 0;
}
bool Miller_Rabin(long long n) {
  if (n == 1) return 0;
  for (int i = 0; i < prs; ++i) {
    if (n % Test[i] == 0) return n == Test[i];
    if (Witness(Test[i], n)) return 0;
  }
  return 1;
}
mt19937 rnd(time(0));
long long gcd(long long x, long long y) {
  if (!(x && y)) return x | y;
  if (!((x | y) & 1)) return gcd(x >> 1, y >> 1) << 1;
  x >>= !(x & 1);
  y >>= !(y & 1);
  return x > y ? gcd(y, x - y) : gcd(x, y - x);
}
void Solve(long long n) {
  if (n == 1) return;
  if (Miller_Rabin(n)) {
    S.insert(n);
    return;
  }
  for (;;) {
    long long x = rnd() % n, y = x, d = 1;
    int k = 2;
    for (int i = 2; i <= 1000000; ++i) {
      long long x2 = mul_mod(x, x, n) - 1;
      if (y != x2) {
        long long nd = mul_mod(d, n + y - x2, n);
        if (nd)
          d = nd;
        else
          break;
      } else
        break;
      if ((i & 127) == 0 || i == k) {
        d = gcd(n, d);
        if (d != 1 && d != n) {
          Solve(d);
          Solve(n / d);
          return;
        }
        d = 1;
      }
      if (i == k) {
        y = x2;
        k = k * 2;
      }
      x = x2;
    }
  }
}
void Factor(long long n) {
  for (int i = 2; i <= 200; ++i)
    while (n % i == 0) n /= i, S.insert(i);
  Solve(n);
}
}  // namespace PR
int n, e;
long long m, b, p;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> b;
  for (int i = 2; (1ll << i) <= m; ++i) {
    long long u = floorl(powl(m, 1. / i) + 0.5), v = ksm(u, i, m);
    if (!v) {
      p = u;
      e = i;
    }
  }
  if (!p)
    p = m, e = 1;
  else
    S.insert(p);
  PR::Factor(p - 1);
  if (b % p == 0) b = 1;
  long long phi = m / p * (p - 1), ord = phi;
  for (long long i : S)
    while (ord % i == 0 && ksm(b, ord / i, m) == 1) ord /= i;
  if (phi - ord >= n) {
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
      for (; ++cnt;)
        if (cnt % p) {
          if (ksm(cnt, ord, m) != 1) break;
          if (p == 2 && e >= 3) {
            if (ord >= 2 && ksm(cnt, ord / 2, m) == 1) {
              if (cnt % 8 != 1) break;
            } else {
              if (cnt % 8 != b % 8) break;
            }
          }
        }
      cout << cnt << " \n"[i == n];
    }
  } else
    cout << -1 << '\n';
  return 0;
}