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;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
static unsigned long long matp2mod(unsigned long long a, int k,
                                   unsigned long long m) {
  a %= m;
  for (int i = 0; i < k; i++) {
    a <<= 1;
    if (a >= m) a -= m;
  }
  return a;
}
static long long matmod(unsigned long long a, unsigned long long b,
                        unsigned long long m) {
  unsigned long long al = a & UINT_MAX;
  unsigned long long ah = a >> 32;
  unsigned long long bl = b & UINT_MAX;
  unsigned long long bh = b >> 32;
  unsigned long long ans1 = al * bl % m;
  unsigned long long ans2 = matp2mod(al * bh % m + ah * bl % m, 32, m);
  unsigned long long ans3 = matp2mod(ah * bh, 64, m);
  return (ans1 + ans2 + ans3) % m;
}
static long long powermod(long long a, long long b, long long m) {
  if (b == 0)
    return 1;
  else if (b & 1)
    return matmod(a, powermod(a, b - 1, m), m);
  else {
    long long t = powermod(a, b / 2, m);
    return matmod(t, t, m);
  }
}
static bool is_prime(long long n) {
  if (n <= 1)
    return false;
  else if (n < 64)
    return (0x28208a20a08a28acULL >> n) & 1;
  else if (n % 2 == 0)
    return false;
  else if (n < 1000000) {
    for (int i = 3; i * i <= n; i += 2)
      if (n % i == 0) return false;
    return true;
  } else {
    long long d = n - 1;
    int r = 0;
    while (!(d & 1)) {
      d >>= 1;
      r++;
    }
    for (long long a = 2; a <= 37; a++)
      if (is_prime(a)) {
        long long x = powermod(a, d, n);
        if (x == 1 || x == n - 1) continue;
        int i;
        for (i = 0; i < r - 1; i++) {
          x = matmod(x, x, n);
          if (x == n - 1) break;
        }
        if (i == r - 1) return false;
      }
    return true;
  }
}
static long long pollard_rho(long long n) {
  std::mt19937_64 engine;
  std::uniform_int_distribution<long long> pick(2, n - 2);
  while (true) {
    long long a, b, s;
    a = b = pick(engine);
    s = pick(engine);
    while (true) {
      a = (matmod(a, a, n) + s) % n;
      b = (matmod(b, b, n) + s) % n;
      b = (matmod(b, b, n) + s) % n;
      if (a == b) break;
      long long g = gcd(llabs(a - b), n);
      if (g > 1) return g;
    }
  }
}
static std::vector<std::pair<long long, int>> factorise(long long n) {
  std::vector<std::pair<long long, int>> out;
  if (n < 1000000) {
    for (int i = 2; i * i <= n; i++)
      if (n % i == 0) {
        n /= i;
        int r = 1;
        while (n % i == 0) {
          n /= i;
          r++;
        }
        out.emplace_back(i, r);
      }
    if (n > 1) out.emplace_back(n, 1);
  } else if (is_prime(n)) {
    out.emplace_back(n, 1);
  } else {
    long long a = pollard_rho(n);
    auto fa = factorise(a);
    auto fb = factorise(n / a);
    auto pa = fa.begin();
    auto pb = fb.begin();
    while (pa != fa.end() && pb != fb.end()) {
      if (pa->first == pb->first) {
        out.emplace_back(pa->first, pa->second + pb->second);
        ++pa;
        ++pb;
      } else if (pa->first < pb->first)
        out.push_back(*pa++);
      else
        out.push_back(*pb++);
    }
    std::copy(pa, fa.end(), std::back_inserter(out));
    std::copy(pb, fb.end(), std::back_inserter(out));
  }
  return out;
}
static long long order(long long x, long long M, long long phi,
                       const vector<pair<long long, int>> &factors) {
  long long ans = phi;
  for (const auto &e : factors) {
    while (ans % e.first == 0 && powermod(x, ans / e.first, M) == 1)
      ans /= e.first;
  }
  return ans;
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  long long N, M, P;
  cin >> N >> M >> P;
  auto factors = factorise(M);
  long long Q = factors[0].first;
  int K = factors[0].second;
  factors = factorise(Q - 1);
  if (K > 1) factors.emplace_back(Q, K - 1);
  long long phi = 1;
  for (const auto &e : factors)
    for (int i = 0; i < e.second; i++) phi *= e.first;
  if (gcd(P, M) > 1) P = 1;
  long long ordP = order(P, M, phi, factors);
  long long good = phi - ordP;
  if (good < N) {
    cout << "-1\n";
    return 0;
  }
  vector<long long> out;
  mt19937_64 engine;
  uniform_int_distribution<long long> dist(2, M - 1);
  long long g;
  if (Q != 2 || K <= 2) {
    do {
      g = dist(engine);
    } while (gcd(g, M) != 1 || order(g, M, phi, factors) != phi);
    long long cur = 1;
    long long step = phi / ordP;
    for (long long i = 1; ((long long)(out).size()) < N; i++) {
      cur = matmod(cur, g, M);
      if (i % step != 0) out.push_back(cur);
    }
  } else {
    bool P1 = (P % 4 == 1);
    if (P1) {
      for (long long i = 3; i < M && ((long long)(out).size()) < N; i += 4)
        out.push_back(i);
    }
    do {
      g = dist(engine);
    } while (g % 4 != 1 || gcd(g, M) != 1 ||
             order(g, M, phi, factors) != phi / 2);
    long long cur = 1;
    long long step = phi / (P1 ? 2 * ordP : ordP);
    for (long long i = 1; ((long long)(out).size()) < N; i++) {
      cur = matmod(cur, g, M);
      if (i % step != 0) {
        out.push_back(cur);
        if (!P1 && ((long long)(out).size()) < N)
          out.push_back(matmod(P, cur, M));
      }
    }
  }
  for (long long v : out) cout << v << ' ';
  cout << '\n';
  return 0;
}