You are given an integer m, and a list of n distinct integers between 0 and m - 1.

You would like to construct a sequence satisfying the properties:

  * Each element is an integer between 0 and m - 1, inclusive. 
  * All prefix products of the sequence modulo m are distinct. 
  * No prefix product modulo m appears as an element of the input list. 
  * The length of the sequence is maximized. 



Construct any sequence satisfying the properties above.

Input

The first line of input contains two integers n and m (0 ≤ n < m ≤ 200 000) — the number of forbidden prefix products and the modulus.

If n is non-zero, the next line of input contains n distinct integers between 0 and m - 1, the forbidden prefix products. If n is zero, this line doesn't exist.

Output

On the first line, print the number k, denoting the length of your sequence.

On the second line, print k space separated integers, denoting your sequence.

Examples

Input

0 5


Output

5
1 2 4 3 0


Input

3 10
2 9 1


Output

6
3 9 2 9 8 0

Note

For the first case, the prefix products of this sequence modulo m are [1, 2, 3, 4, 0].

For the second case, the prefix products of this sequence modulo m are [3, 7, 4, 6, 8, 0].
#include <bits/stdc++.h>
using namespace std;
template <class htpe, class cmp>
using heap = priority_queue<htpe, vector<htpe>, cmp>;
template <class htpe>
using min_heap = heap<htpe, greater<htpe> >;
template <class htpe>
using max_heap = heap<htpe, less<htpe> >;
const int INF = 1791791791;
const long long INFLL = 1791791791791791791ll;
template <int input_buf_size, int output_buf_size>
class FastIO {
  char cbuf[input_buf_size + 1];
  int icur = 0;
  inline bool go_to_next_token() {
    while (cbuf[icur] == ' ' || cbuf[icur] == '\n') icur++;
    while (cbuf[icur] == 0) {
      icur = 0;
      if (fgets(cbuf, sizeof(cbuf), stdin) != cbuf) return false;
      while (cbuf[icur] == ' ' || cbuf[icur] == '\n') icur++;
    }
    return true;
  }

 public:
  string readString() {
    assert(go_to_next_token());
    string ans;
    while (cbuf[icur] != ' ' && cbuf[icur] != '\n' && cbuf[icur] != 0)
      ans.push_back(cbuf[icur++]);
    ans.shrink_to_fit();
    return ans;
  }
  template <class int_type>
  int_type readInt() {
    assert(go_to_next_token());
    int_type x = 0;
    bool m = cbuf[icur] == '-';
    if (m) icur++;
    while ('0' <= cbuf[icur] && cbuf[icur] <= '9') {
      x *= 10;
      x += (cbuf[icur] - '0');
      icur++;
    }
    if (m) x = -x;
    return x;
  }
  bool seekEof() { return !go_to_next_token(); }

 private:
  char obuf[output_buf_size + 1];
  int ocur = 0;
  inline void write_string(const char *str, size_t sz = 0) {
    if (sz == 0) sz = strlen(str);
    if (ocur + sz > output_buf_size) {
      fputs(obuf, stdout);
      fputs(str, stdout);
      ocur = 0;
      obuf[0] = 0;
      return;
    }
    strcpy(obuf + ocur, str);
    ocur += sz;
    obuf[ocur] = 0;
  }

 public:
  template <class int_type>
  void writeInt(int_type x, bool sp = true) {
    char buf[20];
    int c = 0;
    if (x < 0) {
      buf[c++] = '-';
      x = -x;
    }
    int s = c;
    if (x == 0) {
      buf[c++] = '0';
    }
    while (x > 0) {
      buf[c++] = (x % 10) + '0';
      x /= 10;
    }
    for (int i = 0; 2 * i < c - s; i++) {
      swap(buf[s + i], buf[c - 1 - i]);
    }
    buf[c] = 0;
    write_string(buf, c);
    if (sp) write_string(" ", 1);
  }
  void writeString(string s, bool space = true) {
    write_string(s.c_str(), s.size());
    if (space) write_string(" ", 1);
  }
  void writeEndl() { write_string("\n", 1); }
  void flush() {
    fputs(obuf, stdout);
    ocur = 0;
    obuf[0] = 0;
  }

 private:
  bool lflush;

 public:
  FastIO(bool local_flush) {
    obuf[0] = 0;
    lflush = local_flush;
  }
  ~FastIO() { fputs(obuf, stdout); }
};
FastIO<40000000, 10000000> IO(true);
int gcd(int x, int y) {
  while (y != 0) tie(x, y) = make_pair(y, x % y);
  return x;
}
int gcdd(int a, int b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  int d = gcdd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
const int maxn = 2e5 + 179;
int was[maxn];
int is[maxn];
bool deleted[maxn];
vector<int> which[maxn];
int main() {
  int n = IO.readInt<int>();
  int m = IO.readInt<int>();
  for (int i = 0; i < ((int)(n)); ++i) {
    int a = IO.readInt<int>();
    was[gcd(a, m)]++;
    deleted[a] = true;
  }
  vector<int> del;
  for (int i = 1; i * i <= m; i++) {
    if (m % i == 0) {
      del.push_back(i);
      del.push_back(m / i);
    }
  }
  sort((del).begin(), (del).end());
  del.resize(unique((del).begin(), (del).end()) - del.begin());
  for (int i = 0; i < ((int)(m)); ++i) {
    is[gcd(i, m)]++;
    if (!deleted[i]) which[gcd(i, m)].push_back(i);
  }
  vector<int> dp(del.size(), 0);
  vector<int> last(del.size(), -1);
  dp[0] = is[1] - was[1];
  int j = -1;
  for (int u : del) {
    j++;
    if (u == 1) continue;
    for (int i = 1; i * i <= u; i++) {
      if (u % i) continue;
      int k = lower_bound((del).begin(), (del).end(), i) - del.begin();
      if (dp[k] + is[u] - was[u] > dp[j]) last[j] = k;
      dp[j] = max(dp[j], dp[k] + is[u] - was[u]);
      k = lower_bound((del).begin(), (del).end(), u / i) - del.begin();
      if (i != 1) {
        if (dp[k] + is[u] - was[u] > dp[j]) last[j] = k;
        dp[j] = max(dp[j], dp[k] + is[u] - was[u]);
      }
    }
  }
  vector<int> ans;
  int cur = max_element((dp).begin(), (dp).end()) - dp.begin();
  while (cur != -1) {
    ans.push_back(del[cur]);
    cur = last[cur];
  }
  reverse((ans).begin(), (ans).end());
  vector<int> answ;
  int lu = 1;
  int lst = 1;
  for (int u : ans) {
    for (int w : which[u]) {
      long long x, y;
      gcdd(lst / lu, m / lu, x, y);
      x = ((((x) % (m / lu)) + (m / lu)) % (m / lu));
      answ.push_back(((((x * (w / lu)) % (m)) + (m)) % (m)));
      lu = u;
      lst = w;
    }
  }
  IO.writeInt(*max_element((dp).begin(), (dp).end()));
  IO.writeEndl();
  for (int u : answ) {
    IO.writeInt(u);
  }
  IO.writeEndl();
  return 0;
}
