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 ul = std::uint32_t;
using li = std::int32_t;
using ll = std::int64_t;
using ull = std::uint64_t;
using vul = std::vector<ul>;
using vvul = std::vector<vul>;
using pulul = std::pair<ul, ul>;
using llf = long double;
std::mt19937_64 rnd;
ul n;
ull p, m;
ul a;
ull q;
ull phi;
ull power(ull a, ul b) {
  ull ret = 1;
  while (b) {
    if (b & 1) {
      ret *= a;
    }
    b >>= 1;
    a *= a;
  }
  return ret;
}
ull plus(ull a, ull b, ull base) { return a + b < base ? a + b : a + b - base; }
ull minus(ull a, ull b, ull base) { return a < b ? a + base - b : a - b; }
ull mul(ll a, ll b, ll base) {
  ll temp = a * b - ll(llf(a) * llf(b) / llf(base)) * ll(base);
  return temp < 0 ? temp + base : (temp >= base ? temp - base : temp);
}
ull pow(ull a, ull b, ull base) {
  ull ret = 1;
  while (b) {
    if (b & 1) {
      ret = mul(ret, a, base);
    }
    b >>= 1;
    a = mul(a, a, base);
  }
  return ret;
}
const ul tim = 12;
bool miller_rabin(ull x) {
  if (x == 1) {
    return false;
  }
  if (x == 0) {
    return false;
  }
  if (x == 2) {
    return true;
  }
  if (x % 2 == 0) {
    return false;
  }
  ull s;
  for (s = x - 1; ~s & 1; s >>= 1)
    ;
  for (ul i = 0; i != tim; ++i) {
    ull t = rnd() % x;
    if (t == 0) {
      continue;
    }
    if (pow(t, x - 1, x) != 1) {
      return false;
    }
    t = pow(t, s, x);
    if (t == 1) {
      continue;
    }
    while (true) {
      if (t == x - 1) {
        break;
      }
      t = mul(t, t, x);
      if (t == 1) {
        return false;
      }
    }
  }
  return true;
}
ull gcd(ull a, ull b) {
  while (a) {
    a ^= b ^= a ^= b %= a;
  }
  return b;
}
ull pollard_rho(ull x) {
  while (true) {
    ull a = rnd() % x, c = rnd() % x, b = plus(mul(a, a, x), c, x);
    while (a != b) {
      ull temp = gcd(minus(b, a, x), x);
      if (temp != 1) {
        return temp;
      }
      a = plus(mul(a, a, x), c, x);
      b = plus(mul(b, b, x), c, x);
      b = plus(mul(b, b, x), c, x);
    }
  }
}
void getfacts(ull x, std::deque<ull>& queue, std::vector<ull>& ans) {
  queue.resize(0);
  ans.resize(0);
  queue.push_back(x);
  while (queue.size()) {
    ull t = queue.front();
    queue.pop_front();
    if (miller_rabin(t)) {
      ans.push_back(t);
    } else {
      ull s = pollard_rho(t);
      queue.push_back(s);
      queue.push_back(t / s);
    }
  }
}
std::vector<ull> phifacts;
std::deque<ull> queue;
std::vector<ull> mfacts;
std::set<ull> ans;
ull degree(ull x) {
  ull test = phi;
  for (ull t : phifacts) {
    if (pow(x, test / t, m) == 1) {
      test /= t;
    }
  }
  return test;
}
void out() {
  for (auto it = ans.begin(); it != ans.end(); ++it) {
    if (it != ans.begin()) {
      std::printf(" ");
    }
    std::printf("%llu", *it);
  }
  std::printf("\n");
}
int main() {
  rnd.seed(std::time(0));
  std::scanf("%u%llu%llu", &n, &m, &p);
  if (m == 2) {
    std::printf("-1\n");
    return 0;
  }
  getfacts(m, queue, mfacts);
  q = mfacts[0];
  a = mfacts.size();
  if (p % q == 0) {
    if (power(q, a - 1) * (q - 1) - 1 < n) {
      std::printf("-1\n");
      return 0;
    } else {
      for (ull t = 2, cnt = 0; cnt != n; ++t) {
        if (t % q == 0) {
          continue;
        } else {
          if (cnt) {
            std::printf(" ");
          }
          std::printf("%llu", t);
          ++cnt;
        }
      }
      std::printf("\n");
      return 0;
    }
  } else {
    phi = power(q, a - 1) * (q - 1);
    getfacts(phi, queue, phifacts);
    ull degp = degree(p);
    if (degp == phi) {
      std::printf("-1\n");
      return 0;
    }
    if (q != 2 || a == 2) {
      for (ull i = 0; i != m; ++i) {
        if (i % q == 0) {
          continue;
        }
        ull degi = degree(i);
        ull curr = 1;
        if (degi == phi) {
          for (ull j = 0; j != phi; ++j, curr = mul(i, curr, m)) {
            if (j % (phi / degp) == 0) {
              continue;
            }
            ans.insert(curr);
            if (ans.size() == n) {
              out();
              return 0;
            }
          }
          std::printf("-1\n");
          return 0;
        }
      }
    } else {
      if (p % 4 == 1) {
        for (ull i = 1; i < m; i += 4) {
          ull t = mul(i, m / 2 - 1, m);
          ans.insert(t);
          if (ans.size() == n) {
            out();
            return 0;
          }
        }
        if (degp == phi / 2) {
          std::printf("-1\n");
          return 0;
        }
        for (ull i = 1; i < m; i += 4) {
          ull degi = degree(i);
          if (degi == phi / 2) {
            for (ull j = 0, curr = 1; j != phi / 2;
                 ++j, curr = mul(i, curr, m)) {
              if (j % (phi / 2 / degp) == 0) {
                continue;
              }
              ans.insert(curr);
              if (ans.size() == n) {
                out();
                return 0;
              }
            }
            std::printf("-1\n");
            return 0;
          }
        }
      } else if (p != m / 2 - 1 && p != m - 1) {
        for (ul i = 1; i < m; i += 4) {
          ull degi = degree(i);
          if (degi == phi / 2) {
            for (ull j = 0, curr = 1; j != phi / 2;
                 ++j, curr = mul(curr, i, m)) {
              if (j % (phi / 2 / degp) != 0) {
                ans.insert(curr);
                if (ans.size() == n) {
                  out();
                  return 0;
                }
                ans.insert(mul(curr, m / 2 - 1, m));
                if (ans.size() == n) {
                  out();
                  return 0;
                }
              } else {
                ans.insert(mul(pow(p, j / (phi / 2 / degp), m), m / 2 - 1, m));
                if (ans.size() == n) {
                  out();
                  return 0;
                }
              }
            }
            std::printf("-1\n");
            return 0;
          }
        }
      } else {
        for (ull i = 3; i < m; i += 2) {
          if (i == p) {
            continue;
          }
          ans.insert(i);
          if (ans.size() == n) {
            out();
            return 0;
          }
        }
        std::printf("-1\n");
        return 0;
      }
    }
  }
  return 0;
}