Problem: Diana loves playing with numbers. She's got n cards with positive integer numbers a_i written on them. She spends her free time multiplying the numbers on the cards. She picks a non-empty subset of the cards and multiplies all the numbers a_i written on them.

Diana is happy when the product of the numbers ends with her favorite digit d. Now she is curious what cards she should pick so that the product of the numbers on them is the largest possible and the last decimal digit of the product is d. Please, help her.

Input

The first line contains the integers n and d (1≤ n≤ 10^5, 0≤ d≤ 9). The second line contains n integers a_i (1≤ a_i≤ 1000). 

Output

On the first line, print the number of chosen cards k (1≤ k≤ n). On the next line, print the numbers written on the chosen cards in any order. 

If it is impossible to choose a subset of cards with the product that ends with the digit d, print the single line with -1.

Examples

Input


6 4
4 11 8 2 1 13


Output


5
1 2 4 11 13 


Input


3 1
2 4 6


Output


-1


Input


5 7
1 3 1 5 3


Output


-1


Input


6 3
8 9 4 17 11 5


Output


3
9 11 17 


Input


5 6
2 2 2 2 2


Output


4
2 2 2 2 

Note

In the first example, 1 × 2 × 4 × 11 × 13 = 1144, which is the largest product that ends with the digit 4. The same set of cards without the number 1 is also a valid answer, as well as a set of 8, 11, and 13 with or without 1 that also has the product of 1144.

In the second example, all the numbers on the cards are even and their product cannot end with an odd digit 1.

In the third example, the only possible products are 1, 3, 5, 9, 15, and 45, none of which end with the digit 7.

In the fourth example, 9 × 11 × 17 = 1683, which ends with the digit 3. 

In the fifth example, 2 × 2 × 2 × 2 = 16, which ends with the digit 6.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;


public class Solution {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
    static boolean isLocal = false;

    int n, d, a[], mx = 2000000000;
    double dp[][];
    List<Integer> res = new ArrayList<>();

    double go(int i, int rem, int token) {
        if (i < 0) return rem == d && token == 1 ? 1 : -mx;
        if (dp[rem][i] != -mx) return dp[rem][i];
        return dp[rem][i] = max(Math.log(a[i]) + go(i - 1, (rem * a[i]) % 10, 1), go(i - 1, rem, token));
    }

    void Case() throws IOException {
        n = nextInt();
        d = nextInt();
        a = na(n);
        dp = new double[10][n];
        for (int i = 0; i < 10; i++) Arrays.fill(dp[i], -mx);
        if (go(n - 1, 1, 0) < 0) out.println(-1);
        else {
            int rem = 1, token = 0;
            for(int i = n -1; i >= 0; i--) {
                if(go(i,rem, token) != go(i-1,rem, token)) {
                    token = 1;
                    rem = (rem * a[i]) % 10;
                    res.add(a[i]);
                }
            }
            out.println(res.size());
            for (int x : res) out.print(x + " ");
        }
    }

    void solve() throws Exception {
        int t = 1;// nextInt();
        for (int i = 1; i <= t; i++) {
//            out.println("Case #" + i + ":");
            Case();
        }
    }

    private long pow2(int x) {
        return 1L << x;
    }

    private int gcd(int a, int b) {
        while (b > 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    int min(int x, int y) {
        return Integer.min(x, y);
    }

    int max(int x, int y) {
        return Integer.max(x, y);
    }

    double min(double x, double y) {
        return Double.min(x, y);
    }

    double max(double x, double y) {
        return Double.max(x, y);
    }

    long min(long x, long y) {
        return Long.min(x, y);
    }

    long max(long x, long y) {
        return Long.max(x, y);
    }

    int[] sort(int[] arr) {
        sort(arr, 0, arr.length - 1);
        return arr;
    }

    void sort(int arr[], int l, int r) {
        if (l < r) {
            int m = (l + r) / 2;
            sort(arr, l, m);
            sort(arr, m + 1, r);
            merge(arr, l, m, r);
        }
    }

    void merge(int arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int[n1];
        int R[] = new int[n2];
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            } else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    class Seg implements Comparable<Seg> {
        int st, end;

        public Seg(int st, int end) {
            this.st = st;
            this.end = end;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Seg seg = (Seg) o;
            return st == seg.st &&
                    end == seg.end;
        }

        @Override
        public int hashCode() {
            return Objects.hash(st, end);
        }

        @Override
        public int compareTo(Seg seg) {
            return st == seg.st ? Integer.compare(end, seg.end) : Integer.compare(st, seg.st);
        }
    }

    private int[] na(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    private long[] nal(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return parseLong(next());
    }

    double nextDouble() throws IOException {
        return parseDouble(next());
    }

    String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public static void main(String[] args) throws Exception {
        try {
            if (isLocal) {
                in = new BufferedReader(new FileReader("src/tests/sol.in"));
                out = new PrintWriter(new BufferedWriter(new FileWriter("src/tests/sol.out")));
            } else {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(new OutputStreamWriter(System.out));
            }
//            long lStartTime = System.currentTimeMillis();
            new Solution().solve();
//            long lEndTime = System.currentTimeMillis();
//            out.println("Elapsed time in seconds: " + (double) (lEndTime - lStartTime) / 1000.0);
            in.close();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            exit(1);
        }
    }
}