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;
int const MX = 40000000;
int n;
long long m, p;
bool vis[MX];
vector<long long> v;
inline void ad(long long &x, long long y, long long md) {
  if ((x += y) >= md) x -= md;
}
inline long long add(long long x, long long y, long long md) {
  ad(x, y, md);
  return x;
}
void no() {
  printf("-1\n");
  exit(0);
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void fn(vector<long long> const &v) {
  if (v.size() < n) no();
  printf("%lld", v[0]);
  for (int i = 1; i < (int)(v.size()); ++i) printf(" %lld", v[i]);
  printf("\n");
  exit(0);
}
long long ml(long long a, long long b, long long md) {
  long long an = 0;
  if (b > a) swap(a, b);
  while (b) {
    if (b & 1) ad(an, a, md);
    ad(a, a, md);
    b >>= 1;
  }
  return an;
}
long long pw(long long a, long long p, long long md) {
  long long an = 1;
  while (p) {
    if (p & 1) an = ml(an, a, md);
    a = ml(a, a, md);
    p >>= 1;
  }
  return an;
}
bool isp(long long x) {
  if (x == 2) return true;
  if (!(x & 1)) return false;
  long long p = x - 1;
  while (!(p & 1)) p >>= 1;
  for (int i = 0; i < (int)(10); ++i) {
    int a = rand() % (x - 2) + 2;
    long long z = pw(a, p, x), pp = p;
    if (z == x - 1 || z == 1) continue;
    bool ok = false;
    while (pp << 1 < x) {
      pp <<= 1;
      z = ml(z, z, x);
      if (z == 1) return false;
      if (z == x - 1) {
        ok = true;
        break;
      }
    }
    if (!ok) return false;
  }
  return true;
}
long long sl(long long x) {
  int c = rand() % x, z = 1, i = 0;
  long long a = 2, b = 2;
  while (true) {
    a = add(ml(a, a, x), c, x);
    long long g = gcd(a - b + x, x);
    if (g > 1) return g;
    if (++i == z) z <<= 1, b = a;
  }
}
vector<pair<long long, int> > fac(long long x) {
  if (isp(x)) return vector<pair<long long, int> >{{x, 1}};
  long long z = x;
  while (z == x) z = sl(x);
  vector<pair<long long, int> > v1 = fac(z), v2 = fac(x / z), an;
  int i = 0, j = 0;
  while (i < v1.size() && j < v2.size()) {
    if (v1[i].first == v2[j].first)
      an.push_back(make_pair(v1[i].first, v1[i].second + v2[j].second)), ++i,
          ++j;
    else if (v1[i].first < v2[j].first)
      an.push_back(v1[i]), ++i;
    else
      an.push_back(v2[j]), ++j;
  }
  while (i < v1.size()) an.push_back(v1[i]), ++i;
  while (j < v2.size()) an.push_back(v2[j]), ++j;
  return an;
}
int main() {
  srand(time(0));
  scanf("%d%lld%lld", &n, &m, &p);
  if (gcd(m, p) != 1) {
    for (int i = 2; i < m && v.size() < n; ++i)
      if (gcd(i, m) == 1) v.push_back(i);
    fn(v);
  }
  if (m <= MX) {
    long long x = p;
    while (!vis[x]) vis[x] = true, x = ml(x, p, m);
    for (int i = 2; i < m && v.size() < n; ++i)
      if (!vis[i] && gcd(i, m) == 1) v.push_back(i);
    fn(v);
  }
  int k = 60;
  long long z, w;
  while (k > 1) {
    z = pow(m, 1.0 / k) + 0.5;
    w = 1;
    for (int j = 0; j < (int)(k); ++j) w *= z;
    if (w == m) break;
    --k;
  }
  if (k == 1) z = m;
  long long mu = z - 1;
  for (int i = 1; i < (int)(k); ++i) mu *= z;
  vector<pair<long long, int> > fc = fac(mu);
  long long cl = mu;
  for (int i = 0; i < (int)(fc.size()); ++i)
    while (cl % fc[i].first == 0 && pw(p, cl / fc[i].first, m) == 1)
      cl /= fc[i].first;
  if (mu == cl) no();
  if (z == 2 && k > 2) {
    if (cl * 2 == mu) {
      if (p % 4 == 3) {
        long long z = 5;
        for (int i = 0; i < (int)(n); ++i) v.push_back(z), z = ml(z, m - 5, m);
      } else {
        long long z = 5;
        for (int i = 0; i < (int)(n); ++i) v.push_back(m - z), z = ml(z, 5, m);
      }
    } else {
      long long z = 5;
      for (int i = 0; i < (int)(n); ++i) v.push_back(z), z = ml(z, 25 % m, m);
    }
    fn(v);
  }
  long long q;
  while (true) {
    while (gcd(q = rand() % (m - 2) + 2, m) != 1)
      ;
    bool ok = true;
    for (int i = 0; i < (int)(fc.size()); ++i)
      if (pw(q, mu / fc[i].first, m) == 1) {
        ok = false;
        break;
      }
    if (ok) break;
  }
  int j = 1;
  long long bad = mu / cl;
  w = q;
  for (int i = 0; i < (int)(n); ++i) {
    if (j % bad)
      v.push_back(w);
    else
      --i;
    w = ml(w, q, m);
    ++j;
  }
  fn(v);
}