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].
import java.util.*;
import java.io.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class C {
    FastScanner in;
    PrintWriter out;

    int gcd(int a, int b) {
        while (b != 0) {
            a %= b;
            int tmp = a;
            a = b;
            b = tmp;
        }
        return a;
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        Set<Integer> set = new TreeSet<>();
        for (int i = 0; i < m; i++) {
            set.add(i);
        }
        for (int i = 0; i < n; i++) {
            set.remove(in.nextInt());
        }
        SortedMap<Integer, List<Integer>> map = new TreeMap<>();
        for (int x : set) {
            int g = gcd(x, m);
            if (!map.containsKey(g)) {
                map.put(g, new ArrayList<>());
            }
            map.get(g).add(x);
        }
        int[] num = new int[map.size()];
        int[] a = new int[map.size()];
        List[] lists = new List[map.size()];
        int sz = 0;
        for (Map.Entry<Integer, List<Integer>> p : map.entrySet()) {
            num[sz] = p.getKey();
            a[sz] = p.getValue().size();
            lists[sz] = p.getValue();
            sz++;
        }
        n = a.length;
        int[] d = new int[n];
        int[] to = new int[n];
        for (int i = n - 1; i >= 0; --i) {
            int ans = 0;
            int ansi = -1;
            for (int j = i + 1; j < n; ++j) {
                if (num[j] % num[i] == 0 && d[j] > ans) {
                    ans = d[j];
                    ansi = j;
                }
            }
            d[i] = ans + a[i];
            to[i] = ansi;
        }
        List<Integer> list = new ArrayList<>();
        int s = 0;
        for (int i = 0; i < d.length; i++) {
            if (d[i] > d[s]) {
                s = i;
            }
        }
        while (s != -1) {
            list.addAll(lists[s]);
            s = to[s];
        }
//        System.err.println(list);
        List<Integer> ans = get(list, m);
        out.println(ans.size());
        ans.forEach(x -> out.print(x + " "));
        out.println();
    }

    List<Integer> get(List<Integer> a, int m) {
        List<Integer> ans = new ArrayList<>();
        ans.add(a.get(0));
        for (int i = 1; i < a.size(); i++) {
            int x = a.get(i - 1);
            int y = a.get(i);
            ans.add(get(x, y, m));
        }
        return ans;
    }

    int get(int from, int to, int m) {
        int g = egcd(from, m);
        X %= m;
        X += m;
        X %= m;
        return (int) (((long)to / g * X) % m);
    }

    long X, Y;
    int egcd(int a, int b) {
        if (a == 0) {
            X = 0; Y = 1;
            return b;
        }
        int d = egcd (b%a, a);
        long tmp = X;
        X = Y - (b / a) * X;
        Y = tmp;
        return d;
    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            Locale.setDefault(Locale.US);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg) {
        new C().run();
    }
}