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>
const int D = 21, C = 1000001;
using namespace std;
using ll = long long;
ll pom[C];
void Sebasort(ll tab[], int l, int r) {
  int lim = 2, limi = l + 1, limj = l + 2, j = limi, i = l, k = l;
  while (lim / 2 <= r - l + 1) {
    while (i <= r) {
      if (limj > r) limj = r + 1;
      if ((j < limj && tab[j] < tab[i]) || i >= limi)
        pom[k] = tab[j], j++;
      else
        pom[k] = tab[i], i++;
      k++;
      if (i == limi && j == limj) limi += lim, limj += lim, i = j, j = limi;
    }
    for (i = l; i <= r; i++) tab[i] = pom[i];
    lim *= 2, limi = l + lim / 2, limj = l + lim, j = limi, i = k = l;
  }
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  ll c;
  while (b > 0) c = a % b, a = b, b = c;
  return a;
}
inline ll mul(ll a, ll b, ll M) {
  if (b == 0) return 0;
  ll c = 0;
  while (b > 0) {
    if (b % 2 == 1) c = (c + a) % M;
    b /= 2;
    a = (a + a) % M;
  }
  return c;
}
inline ll pow(ll a, ll b, ll M) {
  if (b == 0) return 1;
  ll c = 1;
  while (b > 0) {
    if (b % 2 == 1) c = mul(a, c, M);
    b /= 2;
    a = mul(a, a, M);
  }
  return c;
}
template <class NUMBER>
int find_divs(int* pr, NUMBER a, NUMBER dv[], int s[]) {
  int ln = 0;
  while (a > 1) {
    if (ln == 0 || pr[a] != dv[ln - 1])
      dv[ln] = pr[a], s[ln] = 1, ln++;
    else
      s[ln - 1]++;
    a /= pr[a];
  }
  return ln;
}
bool determine_prime(ll enigma) {
  ll cur_power, para_toth = enigma - 1;
  int amount = 0, i;
  for (para_toth = enigma - 1, amount = 0; (para_toth & 1) == 0;
       amount++, para_toth >>= 1)
    ;
  for (int test : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}) {
    if (enigma == test) return true;
    cur_power = pow(test, para_toth, enigma);
    if (cur_power == 1 || cur_power == enigma - 1) continue;
    ;
    for (i = 0; i < amount; i++) {
      cur_power = mul(cur_power, cur_power, enigma);
      if (enigma - 1 == cur_power) break;
    }
    if (i == amount) return false;
  }
  return true;
}
void supfactor(int* pr, int v) {
  int i, j;
  pr[1] = 1;
  for (i = 2; i * i < v; i++) {
    if (pr[i] == 0) {
      for (j = i; j < v; j += i) {
        if (pr[j] == 0) pr[j] = i;
      }
    }
  }
  for (; i < v; i++)
    if (pr[i] == 0) pr[i] = i;
}
ll rho_fun(ll x, ll mod, ll c) { return (mul(x, x, mod) + c) % mod; }
ll find_factor_rho(ll number, ll c = 1) {
  ll g = 1, fun1_x = 1, fun2_x = 1;
  while (g == 1) {
    fun1_x = rho_fun(fun1_x, number, c);
    fun2_x = rho_fun(rho_fun(fun2_x, number, c), number, c);
    g = gcd(max((fun2_x - fun1_x), (fun1_x - fun2_x)), number);
  }
  return g;
}
ll tmp_dv2[D];
int tmp_s2[D];
int merge(ll tmp_dv[], int tmp_s[], int tmp_ln, ll dv[], int s[], int old_ln) {
  int tmp_ln2 = old_ln, i = 0, j = 0, k = 0;
  for (i = 0; i < old_ln; i++) tmp_dv2[i] = dv[i];
  for (i = 0; i < old_ln; i++) tmp_s2[i] = s[i];
  for (i = 0, j = 0; i < tmp_ln || j < tmp_ln2;) {
    if (j >= tmp_ln2 || (i < tmp_ln && tmp_dv[i] < tmp_dv2[j]))
      dv[k] = tmp_dv[i], s[k] = tmp_s[i], i++;
    else if (i >= tmp_ln || tmp_dv[i] > tmp_dv2[j])
      dv[k] = tmp_dv2[j], s[k] = tmp_s2[j], j++;
    else
      dv[k] = tmp_dv[i], s[k] = tmp_s[i] + tmp_s2[j], i++, j++;
    k++;
  }
  return k;
}
ll tmp_FIFO[D], tmp_dv[D];
int tmp_s[D];
int dissolve(ll number, ll dv[], int s[], int* pr = nullptr, int ln_p = 0) {
  if (number == 1) return 0;
  int ln = 0, iF, jF, is_prime, tmp_ln;
  ll v, divisor, some_c = 1;
  tmp_FIFO[0] = number;
  for (iF = 0, jF = 1; iF < jF; iF++) {
    v = tmp_FIFO[iF];
    if (v < ln_p) {
      tmp_ln = find_divs<ll>(pr, v, tmp_dv, tmp_s);
      ln = merge(tmp_dv, tmp_s, tmp_ln, dv, s, ln);
      continue;
    }
    is_prime = determine_prime(v);
    tmp_dv[0] = v, tmp_s[0] = 1;
    if (is_prime)
      ln = merge(tmp_dv, tmp_s, 1, dv, s, ln);
    else {
      divisor = v, some_c = 1;
      while (divisor == v) divisor = find_factor_rho(v, some_c++);
      tmp_FIFO[jF] = divisor;
      tmp_FIFO[jF + 1] = v / divisor;
      jF += 2;
    }
  }
  return ln;
}
ll find_order(ll g, ll mod, ll toth, ll dv[], int s[], int ln) {
  int i, j;
  ll cur_ord = toth;
  for (i = 0; i < ln; i++) {
    for (j = 0; j < s[i]; j++) {
      if (pow(g, cur_ord / dv[i], mod) != 1) break;
      cur_ord /= dv[i];
    }
  }
  return cur_ord;
}
ll prob_primitive_root(ll mod, ll toth, ll starter, ll dv[], int ln) {
  int i;
  ll g, d = 1ll * RAND_MAX + 1;
  while (1) {
    g = (rand() * d + rand()) % mod;
    if (g % starter == 0) continue;
    for (i = 0; i < ln; i++) {
      if (pow(g, toth / dv[i], mod) == 1) break;
    }
    if (i == ln) break;
  }
  return g;
}
ll prob_order_not_less(ll mod, ll order, ll toth, ll starter, ll dv[], int s[],
                       int ln) {
  ll g, d = 1ll * RAND_MAX + 1;
  while (1) {
    g = (rand() * d + rand()) % mod;
    if (g % starter == 0) continue;
    if (find_order(g, mod, toth, dv, s, ln) >= order) return g;
  }
}
ll dv_mod[D], dv_toth[D], all_solutions[C];
int s_mod[D], s_toth[D], primes[C];
int main() {
  srand(time(NULL));
  ll m, p, toth, order, g, proot, iterated;
  int limit, ln, solved, i, j;
  supfactor(primes, C);
  scanf("%d %lld %lld", &limit, &m, &p);
  dissolve(m, dv_mod, s_mod, primes, C);
  toth = (m / dv_mod[0]) * (dv_mod[0] - 1);
  ln = dissolve(toth, dv_toth, s_toth, primes, C);
  if (gcd(p, m) > 1 && toth - 1 >= limit) {
    for (solved = 0, i = 2; solved < limit; i++) {
      if (i % dv_mod[0] == 0)
        continue;
      else
        printf("%d ", i), solved++;
    }
    printf("\n");
    return 0;
  }
  order = find_order(p, m, toth, dv_toth, s_toth, ln);
  if (toth - order < limit || gcd(p, m) > 1) {
    printf("-1\n");
    return 0;
  }
  if (order < C) {
    all_solutions[0] = 1, g = p;
    for (i = 1; i < order; i++) {
      all_solutions[i] = g;
      g = mul(g, p, m);
    }
    Sebasort(all_solutions, 0, order - 1);
    for (solved = 0, i = 1, j = 0; solved < limit; i++) {
      if (i % dv_mod[0] == 0) continue;
      if (all_solutions[j] == i)
        j++;
      else
        printf("%d ", i), solved++;
    }
    printf("\n");
    return 0;
  }
  if (dv_mod[0] != 2)
    proot = prob_primitive_root(m, toth, dv_mod[0], dv_toth, ln);
  else if (m % 8 == 1 || m % 8 == 7)
    proot =
        prob_order_not_less(m, toth / 2, toth, dv_mod[0], dv_toth, s_toth, ln);
  else
    proot = ((m % 4 == 1) ? (p - 2) : (p + 2));
  g = 1, iterated = toth / order;
  for (solved = 0, i = 1; solved < limit; i++) {
    g = mul(g, proot, m);
    if ((i % iterated == 0 && dv_mod[0] != 2) || (dv_mod[0] == 2 && i % 2 == 0))
      continue;
    printf("%lld ", g), solved++;
  }
  printf("\n");
  return 0;
}