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;
inline char nc() {
  return getchar();
  static char buf[100000], *l = buf, *r = buf;
  return l == r && (r = (l = buf) + fread(buf, 1, 100000, stdin), l == r)
             ? EOF
             : *l++;
}
template <class T>
void read(T &x) {
  x = 0;
  int f = 1, ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 - '0' + ch;
    ch = nc();
  }
  x *= f;
}
template <class T>
inline T ABS(T x) {
  return x < 0 ? -x : x;
}
int n;
long long m, p;
vector<long long> an;
vector<long long> prime;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
inline long long add(long long x, long long mod) {
  return x >= mod ? x - mod : x;
}
inline long long mul(long long x, long long y, long long mod) {
  static const long long M0 = 1e9, M1 = 1e12;
  if (mod <= M0) return x * y % mod;
  if (mod <= M1)
    return (((x * (y >> 20) % mod) << 20) + x * (y & ((1 << 20) - 1))) % mod;
  long long re = x * y - (long long)((long double)x * y / mod + 0.5) * mod;
  return re < 0 ? re + mod : re;
}
long long power(long long x, long long y, long long mod) {
  long long re = 1;
  while (y) {
    if (y & 1) re = mul(re, x, mod);
    x = mul(x, x, mod);
    y >>= 1;
  }
  return re;
}
namespace miller_rabin {
const int a[] = {2, 3, 7, 11, 19, 31};
long long q;
int k;
bool witness(long long a, long long p) {
  a = power(a, q, p);
  if (a == 1 || a == p - 1) return 0;
  for (int i = 1; i < k; ++i) {
    a = mul(a, a, p);
    if (a == p - 1) return 0;
  }
  return 1;
}
bool check(long long p) {
  if (p == 1) return 0;
  if (p == 2) return 1;
  if (~p & 1) return 0;
  q = p - 1, k = 0;
  while (~q & 1) q >>= 1, ++k;
  for (int i = 0; i < 6; ++i)
    if (a[i] < p) {
      if (witness(a[i], p)) return 0;
    }
  return 1;
}
}  // namespace miller_rabin
namespace pollard_rho {
long long find(long long n, long long c) {
  long long x = rand() % n, y = x;
  while (true) {
    x = add(mul(x, x, n) + c, n);
    y = add(mul(y, y, n) + c, n);
    y = add(mul(y, y, n) + c, n);
    long long d = gcd(ABS(x - y), n);
    if (d == n) return 1;
    if (d != 1) return d;
  }
}
void find(long long n) {
  if (miller_rabin::check(n)) {
    prime.push_back(n);
    return;
  }
  while (true) {
    long long d = find(n, rand() % n);
    if (d != 1) {
      find(d), find(n / d);
      return;
    }
  }
}
void sol(long long n) {
  prime.clear();
  while (~n & 1) prime.push_back(2), n >>= 1;
  if (n == 1) return;
  find(n);
}
}  // namespace pollard_rho
int main() {
  srand((unsigned long long)(new char));
  read(n), read(m), read(p);
  pollard_rho::sol(m);
  long long q = prime[0], phi = m - m / q;
  int k = prime.size();
  if (gcd(m, p) != 1) {
    if (phi - 1 < n) {
      puts("-1");
      return 0;
    }
    for (int i = 2;; ++i)
      if (i % q) {
        an.push_back(i);
        if (--n == 0) break;
      }
  } else {
    pollard_rho::sol(phi);
    long long ord = phi;
    for (int i = 0; i < prime.size(); ++i) {
      if (power(p, ord / prime[i], m) == 1) ord /= prime[i];
    }
    if (phi - ord < n) {
      puts("-1");
      return 0;
    }
    sort(prime.begin(), prime.end());
    prime.reserve(unique(prime.begin(), prime.end()) - prime.begin());
    long long g;
    if (q == 2 && k >= 3) {
      for (g = 1;; g += 4) {
        if (power(g, phi / 2, m) != 1) continue;
        bool ok = 1;
        for (int i = 0; i < prime.size(); ++i) {
          if (power(g, phi / 2 / prime[i], m) == 1) {
            ok = 0;
            break;
          }
        }
        if (ok) break;
      }
    } else {
      for (g = 1;; ++g) {
        if (power(g, phi, m) != 1) continue;
        bool ok = 1;
        for (int i = 0; i < prime.size(); ++i) {
          if (power(g, phi / prime[i], m) == 1) {
            ok = 0;
            break;
          }
        }
        if (ok) break;
      }
    }
    if (q == 2 && k >= 3 && (p & 3) == 3) {
      long long u = 1, v = p, s = phi / ord;
      for (int e = 0;; ++e, u = mul(u, g, m), v = mul(v, g, m))
        if (e % s) {
          an.push_back(u);
          if (--n == 0) break;
          an.push_back(v);
          if (--n == 0) break;
        }
    } else {
      long long u = 1, s = q == 2 ? phi / 2 / ord : phi / ord;
      for (int e = 0;; ++e, u = mul(u, g, m)) {
        if (e % s) {
          an.push_back(u);
          if (--n == 0) break;
        }
        if (q == 2) {
          an.push_back(m - u);
          if (--n == 0) break;
        }
      }
    }
  }
  for (int i = 0; i < an.size(); ++i) {
    if (i) printf(" ");
    printf("%lld", an[i]);
  }
  printf("\n");
  return 0;
}