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>
template <typename T>
inline T max(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
inline T min(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <typename T>
inline bool repr(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool repl(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline T gcd(T a, T b) {
  T t;
  if (a < b) {
    while (a) {
      t = a;
      a = b % a;
      b = t;
    }
    return b;
  } else {
    while (b) {
      t = b;
      b = a % b;
      a = t;
    }
    return a;
  }
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
struct Cg {
  __attribute__((always_inline)) inline char operator()() { return getchar(); }
};
struct Cp {
  __attribute__((always_inline)) inline void operator()(char x) { putchar(x); }
};
__attribute__((always_inline)) inline bool IS(char x) {
  return x == 10 || x == 13 || x == ' ';
}
template <typename T>
struct Fr {
  T P;
  __attribute__((always_inline)) inline Fr &operator,(int &x) {
    x = 0;
    unsigned char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (f) x = -x;
    return *this;
  }
  __attribute__((always_inline)) inline operator int() {
    int x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(long long &x) {
    x = 0;
    unsigned char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (f) x = -x;
    return *this;
  }
  __attribute__((always_inline)) inline operator long long() {
    long long x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(char &x) {
    for (x = P(); IS(x); x = P())
      ;
    return *this;
  }
  __attribute__((always_inline)) inline operator char() {
    char x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(char *x) {
    char t = P();
    for (; IS(t); t = P())
      ;
    if (~t) {
      for (; !IS(t) && ~t; t = P()) *x++ = t;
    }
    *x++ = 0;
    return *this;
  }
  __attribute__((always_inline)) inline Fr &operator,(double &x) {
    x = 0;
    unsigned char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (t == '.') {
      double u = 0.1;
      for (t = P(); t >= '0' && t <= '9'; t = P(), u *= 0.1) x += u * (t - '0');
    }
    if (f) x = -x;
    return *this;
  }
  __attribute__((always_inline)) inline operator double() {
    double x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(long double &x) {
    x = 0;
    unsigned char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (t == '.') {
      double u = 0.1;
      for (t = P(); t >= '0' && t <= '9'; t = P(), u *= 0.1) x += u * (t - '0');
    }
    if (f) x = -x;
    return *this;
  }
  __attribute__((always_inline)) inline operator long double() {
    long double x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(unsigned int &x) {
    x = 0;
    unsigned char t = P();
    while (t < '0' || t > '9') t = P();
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    return *this;
  }
  __attribute__((always_inline)) inline operator unsigned int() {
    unsigned int x;
    *this, x;
    return x;
  }
  __attribute__((always_inline)) inline Fr &operator,(unsigned long long &x) {
    x = 0;
    unsigned char t = P();
    while (t < '0' || t > '9') t = P();
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    return *this;
  }
  __attribute__((always_inline)) inline operator unsigned long long() {
    unsigned long long x;
    *this, x;
    return x;
  }
};
Fr<Cg> in;
template <typename T>
struct Fw {
  T P;
  __attribute__((always_inline)) inline Fw &operator,(int x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      unsigned char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(int x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      unsigned char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator,(unsigned int x) {
    if (x) {
      unsigned char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(unsigned int x) {
    if (x) {
      unsigned char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator,(long long x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      unsigned char s[19], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(long long x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      unsigned char s[19], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator,(unsigned long long x) {
    if (x) {
      unsigned char s[20], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(unsigned long long x) {
    if (x) {
      unsigned char s[20], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator,(char x) {
    P(x);
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(char x) {
    P(x);
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator,(const char *x) {
    while (*x) P(*x++);
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(const char *x) {
    while (*x) P(*x++);
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(double x, int y) {
    if (y) {
      double t = 0.5;
      for (int i = y; i--;) t *= 0.1;
      if (x >= 0)
        x += t;
      else
        x -= t, P('-');
      *this, (long long)(abs(x));
      P('.');
      if (x < 0) x = -x;
      while (y--) {
        x *= 10;
        x -= floor(x * 0.1) * 10;
        P(((int)x) % 10 + '0');
      }
    } else if (x >= 0)
      *this, (long long)(x + 0.5);
    else
      *this, (long long)(x - 0.5);
    ;
    return *this;
  }
  __attribute__((always_inline)) inline Fw &operator()(long double x, int y) {
    if (y) {
      double t = 0.5;
      for (int i = y; i--;) t *= 0.1;
      if (x >= 0)
        x += t;
      else
        x -= t, P('-');
      *this, (long long)(abs(x));
      P('.');
      if (x < 0) x = -x;
      while (y--) {
        x *= 10;
        x -= floor(x * 0.1) * 10;
        P(((int)x) % 10 + '0');
      }
    } else if (x >= 0)
      *this, (long long)(x + 0.5);
    else
      *this, (long long)(x - 0.5);
    ;
    return *this;
  }
};
Fw<Cp> out;
inline unsigned long long mrand() {
  static unsigned long long s = 124124124713812490;
  return s += s << 2 | 1;
}
inline long long mul(long long a, long long b, long long c) {
  a %= c, b %= c;
  long long t = a * b - (long long)((long double)a * b / c + 0.5) * c;
  if (t < 0) return t + c;
  return t;
}
inline long long pow(long long a, long long b, long long c) {
  long long r = 1;
  for (; b; b >>= 1, a = mul(a, a, c))
    if (b & 1) r = mul(a, r, c);
  return r;
}
std::map<long long, int> ys;
inline bool mr(long long x) {
  if (x == 2) return 1;
  if (x < 2 || (~x & 1)) return 0;
  long long u = x - 1, p, a, b;
  int t = 0;
  while (~u & 1) u >>= 1, t++;
  for (int i = 0, iend = 5; i < iend; i++) {
    p = mrand() % (x - 1) + 1;
    a = pow(p, u, x);
    for (int j = 0, jend = t; j < jend; j++) {
      b = mul(a, a, x);
      if (b == 1 && a != 1 && a != x - 1) return 0;
      a = b;
    }
    if (a != 1) return 0;
  }
  return 1;
}
inline long long f(long long a, long long b, long long n) {
  return (mul(a, a, n) + b) % n;
}
void pr(long long n) {
  if (n == 1) return;
  if (mr(n)) {
    ys[n]++;
    return;
  }
  if (n == 4) {
    ys[2] += 2;
    return;
  }
  long long a, x, y, p;
  while (1) {
    a = mrand() & 63, x = y = 2;
    while (1) {
      x = f(x, a, n), y = f(f(y, a, n), a, n);
      if (x == y) break;
      p = gcd(n, abs(x - y));
      if (p > 1) {
        pr(p), pr(n / p);
        return;
      }
    }
  }
}
int n, mc;
long long m, ma, p, phi;
inline long long spow(long long a, long long b) {
  long long r = 1;
  while (b) b--, r *= a;
  return r;
}
inline long long qpow(long long a, long long b) {
  long long r = 1;
  for (; b; b >>= 1, a = mul(a, a, m))
    if (b & 1) r = mul(r, a, m);
  return r;
}
inline void solve2() {
  long long t = 4;
  while ((p % t == 1 || p % t == t - 1) && t <= m) t <<= 1;
  if (p == 1) {
    std::vector<long long> ans;
    for (long long i = 3; i < m; i++) {
      if (i & 1) ans.push_back(i);
      if (ans.size() == n) break;
    }
    if (ans.size() != n) {
      out, -1, '\n';
    } else {
      for (__typeof((ans).end()) i = (ans).begin(); i != (ans).end(); ++i)
        out, *i, ' ';
      out, '\n';
    }
    return;
  }
  long long pt = p % t;
  {
    std::vector<long long> ans;
    for (long long i = 0; i < m; i++) {
      bool tt = (i & (t - 1)) == pt || (i & (t - 1)) == 1;
      if ((i & 1) && !tt) ans.push_back(i);
      if (ans.size() == n) break;
    }
    if (ans.size() != n) {
      out, -1, '\n';
    } else {
      for (__typeof((ans).end()) i = (ans).begin(); i != (ans).end(); ++i)
        out, *i, ' ';
      out, '\n';
    }
  }
}
int main() {
  in, n, m, p;
  for (int i = 2, iend = 2333; i <= iend; i++) {
    if (m % i == 0) {
      ma = i;
      while (m > 1) m /= i, mc++;
      break;
    }
  }
  if (!ma) {
    for (int i = 7; i; i--) {
      long long t = expl(logl(m) / i);
      while (spow(t, i) <= m) t++;
      while (spow(t, i) > m) t--;
      if (spow(t, i) == m) {
        ma = t, mc = i;
        break;
      }
    }
  }
  m = spow(ma, mc);
  if (p % ma == 0) {
    std::vector<long long> ans;
    for (long long i = 2; i < m; i++) {
      if (i % ma) ans.push_back(i);
      if (ans.size() == n) break;
    }
    if (ans.size() != n) {
      out, -1, '\n';
    } else {
      for (__typeof((ans).end()) i = (ans).begin(); i != (ans).end(); ++i)
        out, *i, ' ';
      out, '\n';
    }
    return 0;
  }
  if (ma == 2) return solve2(), 0;
  phi = spow(ma, mc - 1) * (ma - 1);
  pr(ma - 1);
  for (int i = 0, iend = mc - 1; i < iend; i++) ys[ma]++;
  long long up = phi;
  assert(qpow(p, up) == 1);
  for (__typeof((ys).end()) i = (ys).begin(); i != (ys).end(); ++i) {
    while (up % i->first == 0) {
      if (qpow(p, up / i->first) == 1)
        up /= i->first;
      else
        break;
    }
  }
  if (m - spow(ma, mc - 1) - up < n) {
    out, -1, '\n';
    return 0;
  }
  std::vector<long long> ans;
  for (long long i = 0; i < m; i++) {
    if ((i % ma) && qpow(i, up) != 1) ans.push_back(i);
    if (ans.size() == n) break;
  }
  for (__typeof((ans).end()) i = (ans).begin(); i != (ans).end(); ++i)
    out, *i, ' ';
  out, '\n';
}