#include <iostream>
#include <vector>
using namespace std;

int main() {

	int N,X;
	cin>>N>>X;
	
	vector<int> V;
	for(int i=0;i<N;i++)
	{
		int x;
		cin>>x;
		
		if(x != X)
		{
			V.push_back(x);
		}
	}

	for(int i=0;i<V.size();i++)
	{
		if(i == (V.size()-1))
		{
			cout<<V[i]<<endl;
		}
		else
		{
			cout<<V[i]<<" ";
		}
	}


	return 0;
}
#include <bits/stdc++.h>
using namespace std;

char S1[400005];
char S2[400005];
char S3[400005];
char S4[400005];

int main(){
    int T;
    scanf("%d", &T);

    while(T --){
        int N;
        scanf(" %d %s %s %s", &N, S1, S2, S3);

        memset(S4, 0, sizeof(S4));

        for(int i = 0; i < N; i ++){
            S4[i] = '1';
        }

        for(int i = N; i < 2*N; i ++){
            S4[i] = '0';
        }
        S4[2*N] = '1';

        printf("%s\n", S4);
    }
}
