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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long INF = (long long)2e18;
const int B = 6;
long long mult(long long x, long long y, long long md) {
  if (y == 0) return 0;
  return (mult((x * B) % md, y / B, md) + (x * (y % B))) % md;
}
long long bin_pow(long long x, long long p, long long md) {
  if (p == 0) return 1 % md;
  if (p & 1) return mult(x, bin_pow(x, p - 1, md), md);
  return bin_pow(mult(x, x, md), p / 2, md);
}
const int CC = (int)5e6;
bool used[CC + 1];
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
long long F(long long x, long long m) {
  x = mult(x, x, m);
  x++;
  if (x == m) x -= m;
  return x;
}
vector<long long> findDivs(long long m) {
  vector<long long> ans;
  for (long long x = 2; x < CC; x++) {
    if (m % x) continue;
    ans.push_back(x);
    while (m % x == 0) m /= x;
  }
  if (m == 1) return ans;
  if (m < (long long)(CC - 2) * (CC - 2)) {
    ans.push_back(m);
    return ans;
  }
  for (int it = 0; it < 5; it++) {
    long long x = rng() % 100 + 1;
    long long y = x;
    for (int it2 = 0; it2 < 100000; it2++) {
      x = F(x, m);
      y = F(y, m);
      y = F(y, m);
      long long d = gcd(abs(x - y), m);
      if (d != 1 && d != m) {
        ans.push_back(d);
        ans.push_back(m / d);
        return ans;
      }
    }
  }
  ans.push_back(m);
  return ans;
}
long long getOrder(long long g, long long m, long long phi,
                   vector<long long> divs) {
  for (long long x : divs) {
    long long z = bin_pow(g, phi / x, m);
    if (z == 1) return x;
  }
  return 1;
}
long long myPow(long long x, long long p) {
  long long res = 1;
  while (p--) {
    if ((double)res * x > INF) return INF;
    res *= x;
  }
  return min(res, INF);
}
int main() {
  int n;
  long long m, w;
  scanf("%d%lld%lld", &n, &m, &w);
  long long p = m;
  int t = 1;
  for (int k = 2; k < 60; k++) {
    long long z = (long long)(powl(m, 1. / k));
    if (z > 1) z--;
    z = max(z, 1LL);
    while (myPow(z, k) > m) z--;
    while (myPow(z, k) < m) z++;
    if (myPow(z, k) == m) {
      p = z;
      t = k;
    }
  }
  if (m < CC) {
    for (int i = 0; i < m; i++) {
      used[i] = 0;
    }
    long long x = 1;
    while (true) {
      if (used[x]) break;
      used[x] = 1;
      x = (x * w) % m;
    }
    int res = 0;
    for (int i = 0; i < m; i++) {
      if (!used[i] && (i % p != 0)) {
        res++;
      }
    }
    if (res < n) {
      printf("-1\n");
      return 0;
    }
    for (int i = 0; n > 0 && i < m; i++) {
      if (!used[i] && (i % p != 0)) {
        printf("%d ", i);
        n--;
      }
    }
    printf("\n");
    return 0;
  }
  if (w % p == 0) {
    long long res = (m / p) * (p - 1) - 1;
    if (res < n) {
      printf("-1\n");
      return 0;
    }
    for (long long x = 2; n > 0; x++) {
      if (x % p == 0) continue;
      printf("%lld ", x);
      n--;
    }
    printf("\n");
    return 0;
  }
  if (p == 2) {
    int x = 3;
    while (w % 8 == x) x += 2;
    for (int i = 0; i < n; i++) printf("%d ", 8 * i + x);
    printf("\n");
    return 0;
  }
  long long phi = (m / p) * (p - 1);
  vector<long long> divs = findDivs(p - 1);
  if (t > 1) divs.push_back(p);
  long long ord = getOrder(w, m, phi, divs);
  if (ord == 1) {
    printf("-1\n");
    return 0;
  }
  long long g = 0;
  while (true) {
    if (g % p == 0 || getOrder(g, m, phi, divs) != 1) {
      g = rng() % m;
    } else
      break;
  }
  long long x = 1;
  for (int i = 1; n > 0; i++) {
    x = mult(x, g, m);
    if (i % ord != 0) {
      printf("%lld ", x);
      n--;
    }
  }
  printf("\n");
  return 0;
}