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 CPP):

Solution:
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
#include <utility>

using namespace std;
typedef long long int llint;
llint K=1000000000;
vector<llint>kak(vector<llint>in,int a){
	int n=in.size();
	for(int i=0;i<n;i++){in[i]*=a;}
	if(n==0||in[n-1]>K){in.push_back(0);n++;}
	for(int i=0;i+1<n;i++){
		in[i+1]+=in[i]/K;
		in[i]%=K;
	}
	return in;
}
bool dai(vector<llint>in,vector<llint>jn){
	while(in.size()>0&&in.back()==0){in.pop_back();}
	while(jn.size()>0&&jn.back()==0){jn.pop_back();}
	if(in.size()>jn.size()){return true;}
	if(in.size()<jn.size()){return false;}
	for(int i=((int)in.size())-1;i>=0;i--){
		if(in[i]>jn[i]){return true;}
		if(in[i]<jn[i]){return false;}
	}
	return false;
}
int main(void){
	int n,d,i,h,j;cin>>n>>d;
	vector<int>suu[10];
	for(i=0;i<n;i++){
		int a;cin>>a;
		suu[a%10].push_back(a);
	}
	int mir[10];
	for(h=0;h<10;h++){
		sort(suu[h].begin(),suu[h].end());
		mir[h]=(1+suu[h].size())%4 +3;//4の倍数はまとめることができる
		if(mir[h]>suu[h].size()){mir[h]=suu[h].size();}
	}
	
	//mirに入っていないものをみる
	vector<llint>dp[10];
	vector<int>da[10];
	dp[1].push_back(1);
	//これでDPの初期化完了
	for(h=0;h<=9;h++){
		for(i=0;i<mir[h];i++){
			//cerr<<"de"<<endl;
			
			vector<llint>ep[10];
			vector<int>ea[10];
			for(j=0;j<=9;j++){ep[j]=dp[j];ea[j]=da[j];}
			for(j=0;j<=9;j++){
				auto sss=kak(dp[j],suu[h][i]);
				if(dai(sss,ep[h*j%10])){
					ep[h*j%10]=sss;
					ea[h*j%10]=da[j];
					ea[h*j%10].push_back(suu[h][i]);
				}
			}
			for(j=0;j<=9;j++){dp[j]=ep[j];da[j]=ea[j];}
			/*for(j=0;j<=9;j++){
				for(auto it:dp[j]){cerr<<it<<" ";}cerr<<endl;
			}*/
		}
	}
	//まず、da[d]をみる
	vector<int>ans=da[d];
	vector<llint>kra={};
	vector<llint>kkra={0};
	if(dp[d]==kra){cout<<-1<<endl;return 0;}
	if(dp[d]==kkra){cout<<-1<<endl;return 0;}
	if(ans.size()==0){cout<<-1<<endl;return 0;}
	for(i=mir[1];i<suu[1].size();i++){ans.push_back(suu[1][i]);}
	for(i=mir[3];i<suu[3].size();i++){ans.push_back(suu[3][i]);}
	for(i=mir[7];i<suu[7].size();i++){ans.push_back(suu[7][i]);}
	for(i=mir[9];i<suu[9].size();i++){ans.push_back(suu[9][i]);}
	if(d%2==0){
		for(i=mir[2];i<suu[2].size();i++){ans.push_back(suu[2][i]);}
		for(i=mir[4];i<suu[4].size();i++){ans.push_back(suu[4][i]);}
		for(i=mir[6];i<suu[6].size();i++){ans.push_back(suu[6][i]);}
		for(i=mir[8];i<suu[8].size();i++){ans.push_back(suu[8][i]);}
	}
	if(d%5==0){
		for(i=mir[5];i<suu[5].size();i++){ans.push_back(suu[5][i]);}
	}
	if(d%10==0){
		for(i=mir[0];i<suu[0].size();i++){ans.push_back(suu[0][i]);}
	}
	sort(ans.begin(),ans.end());
	cout<<ans.size()<<endl;
	for(auto it:ans){cout<<it<<" ";}cout<<endl;
}
/*
6 4
4 11 8 2 1 13
*/