#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		luint distance;
		luint *favNums;
		int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	for(uint i=0;i<numOfFavNums;i++){
		//cout<<"NumNepe["<<i<<"] = "<<favNums[i]<<endl;
	}
	combinations=calcComb();
	cout<<combinations<<endl;
	delete favNums;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;

	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return 1*-1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	//sort(favNums,favNums+numOfFavNums);
	for(int i=numOfFavNums-1;-1<i;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}

luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if((distance/favNums[numOfFavNums-1])<=2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance%favNums[numOfFavNums-1];
		    }
			if((distance%favNums[numOfFavNums-1])!=0){
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance%favNums[numOfFavNums-1]+1;
		       }
	   }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		luint distance;
		luint *favNums;
		int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	for(uint i=0;i<numOfFavNums;i++){
		//cout<<"NumNepe["<<i<<"] = "<<favNums[i]<<endl;
	}
	combinations=calcComb();
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;

	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if(distance%favNums[numOfFavNums-1]==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if(distance%favNums[numOfFavNums-1]!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		luint bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(luint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=10000000000;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(luint i=0;i<numOfFavNums;i++){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		luint numTCases;
		Rabbit();
		Rabbit(luint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(luint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(luint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(luint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	luint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		luint bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(luint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000002;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(luint i=0;i<numOfFavNums;i++){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<=bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		luint numTCases;
		Rabbit();
		Rabbit(luint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(luint testCases){
	//For each test case
	numTCases=testCases;
	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(luint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(luint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	luint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	sort(v.begin(), v.end());
	for(long int i=v.size()-1;v.size()-1<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}

luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance%favNums[numOfFavNums-1];
		    }
			if((distance%favNums[numOfFavNums-1])!=0){
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance%favNums[numOfFavNums-1]+1;
		       }
	   }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <stdlib.h>
#include <algorithm>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		uint distance;
		luint *favNums;
		long int bandera;
		luint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, luint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, luint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
	combinations=0;
}

void TestCases::printComb(){
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		TestCases *array;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;
	array=new    TestCases[numTCases];
	for(uint i=0;i<numTCases; i++){
		array[i];
	}
	for(uint i=0;i<numTCases; i++){
		array[i].printComb();
	}
	delete [] array;
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		int *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(int arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(int arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new int[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	//delete [] favNums;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases+1);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	//delete [] favNums;
}

luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	//delete [] favNums;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0]), distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}

luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	/*vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	//sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;
	*/
	for(long int i=numOfFavNums-1;i>=0;i--){
		if(distance==favNums[i])
			return 1;
		if(favNums[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%favNums[i])==0)
				nuevaBand=distance/favNums[i];
			else
				nuevaBand=distance/favNums[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		luint numOfFavNums;
		luint distance;
		luint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(luint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(luint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new luint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}
/*
luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=(distance/2)){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		else{
			if((distance%favNums[numOfFavNums-1])==0){
			//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return distance/favNums[numOfFavNums-1];
		    }
			else{
			//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			  return 1+distance/favNums[numOfFavNums-1];
		       }
	   }
	}

}
*/
luint TestCases::calcComb(){
	uint nuevaBand;
	bandera=1000000000;
	vector<uint> v (favNums, favNums + sizeof(favNums) / sizeof(uint) );
	sort(v.begin(), v.end());
	for(long int i=v.size()-1;0<=i;i--){
		if(distance==v[i])
			return 1;
		if(v[i]>=(distance/2))
			nuevaBand=2;
		else{
			if((distance%v[i])==0)
				nuevaBand=distance/v[i];
			else
				nuevaBand=distance/v[i]+1;
		}
		if(nuevaBand<bandera)
			bandera=nuevaBand;
	}
	return bandera;

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	delete [] favNums;
	cout<<combinations<<endl;
}

luint TestCases::calcComb(){
	sort(favNums,favNums+sizeof(favNums)/sizeof(favNums[0]));
	bandera=binarySearch(favNums,0, sizeof(favNums)/sizeof(favNums[0])-1, distance);
	//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


#include <iostream>
#include <algorithm>
#include<vector>
typedef unsigned int uint;
typedef unsigned long int luint;
using namespace std;
class TestCases{
	public:
		uint numOfFavNums;
		uint distance;
		uint *favNums;
		long int bandera;
		uint combinations;
		friend class Rabbit;
		luint calcComb();
		void printComb();
		long int binarySearch(uint arr[], uint l, uint r, uint x);
		TestCases();
};

long int TestCases::binarySearch(uint arr[], uint l, uint r, uint x) {
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x)
            return m;
        if (arr[m] < x)
            l = m + 1;
        else
            r = m - 1;
    }
    return -1;
}

TestCases::TestCases(){
	combinations=0;
	cin>>numOfFavNums>>distance;
	favNums= new uint[numOfFavNums];
	for(uint i=0;i<numOfFavNums;i++){
		cin>>favNums[i];
	}
}

void TestCases::printComb(){
	combinations=calcComb();
	cout<<combinations<<endl;
	delete [] favNums;
}

luint TestCases::calcComb(){
	if(numOfFavNums>1){
		sort(favNums,favNums+numOfFavNums);
		bandera=binarySearch(favNums,0,numOfFavNums-1, distance);
		//cout<<"Distance= "<<distance<< " bandera "<<bandera<<endl;
	}
	else {
		if(favNums[0]==distance)
			bandera=1;
    }
	if(bandera!=-1)
		return 1;
	else{
		if(favNums[numOfFavNums-1]>=distance/2){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
			return 2;
		}
		if((distance%favNums[numOfFavNums-1])==0){
		//cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1];
	    }
		if((distance%favNums[numOfFavNums-1])!=0){
		//	cout<<"Num["<<numOfFavNums-1<<"] = "<<favNums[numOfFavNums-1];
		  return distance%favNums[numOfFavNums-1]+1;
	       }
	}

}

class Rabbit{
	public:
		uint numTCases;
		Rabbit();
		Rabbit(uint);
		void operator=  (const Rabbit&);
};

Rabbit::Rabbit()
	:numTCases(0){}

void Rabbit::operator=(const Rabbit&right){
	numTCases=right.numTCases;
}
Rabbit::Rabbit(uint testCases){
	//For each test case
	numTCases=testCases;

	//array=new    TestCases[numTCases];
	vector<TestCases*>array(numTCases);
	for(uint i=0;i<numTCases; i++){
		array[i]= new TestCases();
	}
	for(uint i=0;i<numTCases; i++){
		array[i]->printComb();
	}
	array.clear();
}

int main(int argc, char* argv[]) {
	Rabbit bugsBunny;
	uint T;
	cin>>T;	//First Line should read Test Cases
	bugsBunny=Rabbit(T);
	return 0;
}


import sys
import math
input = sys.stdin.readline
n = int(input())
s = list(input())
idx = -1
for i in range(n - 1):
  if s[i] != s[i + 1]:
    idx = i
    break
if idx == -1:
  print("NO")
else:
  print("YES")
  print(s[i] + s[i + 1])


l = int(input());
t = input();
s = set(list(t));
if len(s) == 1:
  print("NO");
else:
  print("YES");
  c = t[0];
  for i in s:
    if i != c:
      print(c+i);
      break;


n = int(input())
import sys
s = input()
for i in range(n-2):
    if len({*s[i:i+3]}) == 3:
        print('YES')
        print(s[i:i+3])
        break
else:
    print('NO')


n = int(input())
import sys
s = input()
if len({*s}) == 1:
    print('NO')
    sys.exit()
else:
    for i in range(n-1):
        if s[i] != s[i+1]:
            print(s[i] + s[i+1])
            break


n = int(input())
import sys
s = input()
for i in range(n-2):
    if len({*s[i:i+3]}) == 3:
        print(s[i:i+3])
        break
else:
    print('NO')


n = int(input())
s = input()
for i in range(n-1):
    if s[i] != s[i+1]:
        print('YES')
        print(s[i] + s[i+1])
        break
else:
    print('NO')


n = int(input())
s = list(input())
if s.count(s[0])==n:
    print(-1)
else:
    ans = ''
    i=0
    while i<len(s)-1:
        if s[i]!=s[i+1]:
            ans = s[i]+s[i+1]
            break
        i = i+1
    print("YES")
    print(ans)


n = int(input())
s = list(input())
if s.count(s[0])==n:
    print("NO")
else:
    ans = ''
    i=0
    while i<len(s)-1:
        if s[i]!=s[i+1]:
            ans = s[i]+s[i+1]
            break
        i = i+1
    print("YES")
    print(ans)


input()
s=input()
t=s.strip(s[0])
print(t and'YES\n'+s[0]+t[0]or'NO')


n=int(input())
s=input()
k=s[0]
for i in s:
    if i!=k:
        print('YES')
        print(k+i)
        break
else:
    print('NO')


input()
s = input()
for i in range(len(s)-1):
    if s[i] != s[i+1]:
        print('YES')
        print(s[i]+s[i+1])
        break
else:
    print('NO')


import sys
import bisect
#input=sys.stdin.readline
#t=int(input())
t=1
def solve():
    for i in range(n-1):
        if s[i]!=s[i+1]:
            print("YES")
            return (s[i]+s[i+1])
    return "NO"
mod=10**9+7
for _ in range(t):
    n=int(input())
    #l,r,d=map(int,input().split())
    s=input()
    #l=list(map(int,input().split()))
    print(solve())


n = int(input())
s = input()
if all([c==s[0] for c in s]):
	print("NO")
else:
	print("YES")
	for i in range(n-1):
		if s[i]!=s[i+1]:
			print(s[i]+s[i+1])
			break


n = int(input())
a = input()
ans=''
for i in range(1, n):
    if a[i-1] != a[i]:
        ans = a[i-1] + a[i]
if len(ans) > 0:
    print('YES')
    print(ans)
else:
    print('NO')


n = int(input().strip())
s = input().strip()
found = False
for i in range(n-1):
	if s[i] != s[i+1]:
		print('YES')
		print(s[i:i+2])
		found = True
		break
if not found:
	print('NO')


n = int(input())
s1 = input()
s2 = set(s1)
if len(s2) == 1 :
    print('No')
else :
    print('YES')
    print(s1[0])


n = int(input())
s = input()
flag = False
res = ''
for i in range(n-1):
    if s[i] != s[i+1]:
        res = s[i] + s[i+1]
        flag = True
        break
if flag:
    print("YES")
    print(res)
else:
    print("NO")


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    for i in range(1,n):
        if(s[i-1]!=s[i]):
            a=s[i-1]+s[i]
            print("YES")
            print(a)
            break


for _ in range(int(input())):
    x,y,n=map(int,input().split())
    val=0
    for i in range(x,n+1,x):
        if(i%x==y):
            val=max(val,i)
    print(val)


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    for i in range(1,n):
        if(s[i-1]!=s[i]):
            a=s[i-1]+s[i]
            print("YES")
            print(a)


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    l=[]
    for i in s:
        if(l.count(i)<=n//2):
            l.append(i)
        else:
            break
    l=l[:(n//2)]
    print("YES","".join(l),sep="\n")


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    l=[]
    for i in s:
        if(l.count(i)<=n//2):
            l.append(i)
        else:
            break
    l=l[:(n//2)-1]
    print("YES","".join(l),sep="\n")


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    l=[]
    for i in s:
        if(l.count(i)<=n//2):
            l.append(i)
        else:
            break
    print("YES","".join(l),sep="\n")


n=int(input())
s=input()
d={}
for i in s:
    if(i in d):
        d[i]+=1
    else:
        d[i]=1
if(len(d.items())==1):
    print("NO")
else:
    l=[]
    for i in s:
        if(l.count(i)<=n//2 and i not in l):
            l.append(i)
        else:
            break

    print("YES","".join(l),sep="\n")


n=int(input())
l=list(input())
for i in range(n):
    if len(set(l[i:n//2+i]))>1:
        print("YES")
        z="".join(l[i:n//2+i])
        print(z)
        exit()
print("NO")


n=int(input())
l=list(map(int,input().split()))
for i in range(n-1):
    if l[i]!=l[i+1]:
        print("YES")
        print(l[i],l[i+1],sep='')
        exit()
print("NO")


n=int(input())
l=list(input())
for i in range(n):
    if len(set(l[i:n//2+i]))>1:
        print("YES")
        z="".join(l[i:i+1])
        print(z)
        exit()
print("NO")


n=int(input())
l=list(input())
for i in range(n):
    if len(set(l[i:n//2+i]))>1:
        print("YES")
        z="".join(set(l[i:n//2+i]))
        print(z)
        exit()
print("NO")


n=int(input())
l=list(input())
for i in range(n-1):
    if l[i]!=l[i+1]:
        print("YES")
        print(l[i],l[i+1],sep='')
        exit()
print("NO")


n = int(input())
s = input()
for i in range(n-1):
    if s[i]!=s[i+1]:
        print("YES")
        print(s[i]+s[i+1])
print("NO")


n = int(input())
s = input()
x=''
lst=[]
for i in range(n):
    if s.count(s[i])<=(n/2):
        x+=str(s[i])
    else:
        lst.append(x)
        x=''
if (len(x)!=0):
    lst.append(x)
if (len(lst)>0):
    print("YES")
    print(lst[0])
else:
    print("NO")


n = int(input())
s = input()
for i in range(n-1):
    if s[i]!=s[i+1]:
        print("YES")
        print(s[i]+s[i+1])
        exit()
print("NO")


n = int(input())
s = input()
for i in range(n):
    x = s.count(s[i])
    if x<(n/2):
        print("YES")
        print(s[i])
        exit()
print(-1)


n = int(input())
s = input()
for i in range(n-1):
    x = s.count(s[i])
    x1 = s.count(s[i+1])
    if x<(n/2) and x1<(n/2):
        print("YES")
        print(s[i]+s[i+1])
        exit()
print(-1)


n = int(input())
s = input()
lst = []
for i in range(n):
    if s[i] not in lst:
        lst.append(s[i])
    elif len(lst)>1:
        print("YES")
        print(''.join(lst))
        exit()
print("NO")


n = int(input())
s = input()
for i in range(n-1):
    x = s.count(s[i])
    x1 = s.count(s[i+1])
    if x<(n/2) and x1<(n/2):
        print("YES")
        print(s[i]+s[i+1])
        exit()
print("NO")


n = int(input())
s = input()
x=''
lst=[]
for i in range(n):
    if s.count(s[i])<=(n/2):
        x+=str(s[i])
    else:
        lst.append(x)
        x=''
if (len(x)!=0):
    lst.append(x)
if (len(lst)>0 and len(lst[0])!=0):
    print("YES")
    print(lst[0])
else:
    print("NO")


n = int(input())
s = input()
x=''
for i in range(n):
    if s.count(s[i])<=(n/2):
        x+=s[i]
if (len(x)>0):
    print("YES")
    print(x)
else:
    print("NO")


if __name__ == "__main__":
    n = int(input())
    s = input()
    if n < 2:
        print('NO')
    else:
        for i in range(n-1):
            if s[i] != s[i+1]:
                print('YES')
                print(s[i:i+2])
                break
        else:
            print('NO')


n= int(input())
s = input()
ans = 0
for i in range(n-1):
	if s[i] != s[i+1]:
		ans = 1
		ans1 = i
		break
if ans == 1:
	print("YES")
	print(s[i]+s[i+1])
else:
	print("NO")


k, n, s, p = map(int,input().split())
n2 =  n / s
if n2 != int(n2):
    n2 = (int(n2)+1)
else:
    n2 = int(n2)
n2 = n2*k / p
if n2 != int(n2):
    print((int(n2)+1))
else:
    print(int(n2))


n=int(input())
s=input()
flag=-1
for i in range(0,n-1):
    if(s[i]!=s[i+1]):
        flag=i
        break
if(flag!=-1):
    t=s[flag]+s[flag+1]
    print("YES")
    print(t)
else:
    print("NO")


n = int(input())
s = input()
for i in range(n-2):
    if s[i] != s[i+1] and s[i+1] != s[i+2] and s[i] != s[i+2]:
        print("YES")
        print(s[i]+s[i+1]+s[i+2])
        quit()
print("NO")


n = int(input())
s = input()
for i in range(n-2):
    if s[i] != s[i+1] and s[i+i] != s[i+2] and s[i] != s[i+2]:
        print("YES")
        print(s[i]+s[i+1]+s[i+2])
        quit()
print("NO")


n = int(input())
s = input()
for i in range(n-1):
    if s[i] != s[i+1]:
        print("YES")
        print(s[i]+s[i+1])
        quit()
print("NO")


n = int(input())
s = input()
i,j= 0,1
first = s[i]
for i in range(1,n):
    if s[i]==first:
        continue
    else:
        print('YES')
        print(first+s[i])
        exit(0)
print('NO')


n = int(input())
s = input()
i,j= 0,1
first = s[i]
for i in range(1,n):
    if s[i]==first:
        continue
    else:
        print('YES')
        print(first+s[i])
print('NO')


n = int(input())
s = input()
for i in range(n-1):
    if s[i]!=s[i+1]:
        print("YES")
        print(s[i],s[i+1],sep="")
        break
else:
    print("NO")


def main():
    input()
    string = list(input())

    for i in range(len(string) - 1):
        if string[i] != string[i + 1]:
            print("YES")
            print(''.join(string[i:i + 2]))
            exit(0)
    print("NO")

if __name__ == "__main__":
    main()


n = int(input())
s = input()

ans = None
for i in range(len(s)-1):
    if s[i] != s[i+1]:
        ans = s[i:i+2]
        break

if ans:
    print("YES")
    print(ans)
else:
    print("NO")


#Ashish Sagar
a=int(input())
l=list(input())
flag=0
for i in range(a-1):
    if l[i]!=l[i+1]:
        print("YES")
        print(str(l[i]+l[i+1]))
        flag=1
        break
if flag==0:
    print("NO")


import sys
import math

#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read integers
get_int = lambda: int(sys.stdin.readline())
#to print fast
pt = lambda x: sys.stdout.write(str(x)+'\n')

#--------------------------------WhiteHat010--------------------------------------#
n = get_int()
s = get_string()

flag = False
res = ''
for i in range(n-1):
    if s[i] != s[i+1]:
        res = s[i] + s[i+1]
        flag = True
        break
if flag:
    print("YES")
    print(res)
else:
    print("NO")


n=int(input())
s=input()
f=[0]*(26)
for i in s:
    f[ord(i)-ord('a')]+=1
mm=max(f)
if mm==n or n==1:
    print("NO")
else:
    print("YES")
    ans=""
    for i in range(0,n-1):
        if s[i]!=s[i-1]:
            ans+=(s[i])
            ans+=(s[i+1])
            break
    print(ans)


n=int(input())
s=input()
f=[0]*(26)
for i in s:
    f[ord(i)-ord('a')]+=1
mm=max(f)
if mm==n or n==1:
    print("NO")
else:
    print("YES")
    ans=""
    for i in range(0,n-1):
        if s[i]!=s[i+1]:
            ans+=(s[i])
            ans+=(s[i+1])
            break
    print(ans)


n = int(input())
s = input()

ans = 'NO'

for i in range(n - 1):
    if s[i] != s[i + 1]:
        ans = 'YES' + '\n' + s[i] + s[i + 1]
        break

print(ans)


n = int(input())
s = input()
count = [[0] * 26 for i in range(n)]
a = -1
b = -1
count[0][ord(s[0]) - ord('a')] += 1
for i in range(1, n):
    count[i][ord(s[i]) - ord('a')] += count[i - 1][ord(s[i]) - ord('a')] + 1
for i in range(n):
    for j in range(i + 1, n):
        substr_count = [0] * 26
        for k in range(26):
            substr_count[k] = count[j][k] - count[i][k] + 1
        if max(substr_count) <= (j - i + 1 + 1) // 2:
            a = i
            b = j
if a != -1:
    print("YES")
    print(s[a:b + 1])
else:
    print("NO")


n = int(input())
s = input()
res = "NO"
for i in range(n - 1):
    if s[i] != s[i + 1]:
        res = "YES\n" + s[i] + s[i + 1]
        break
print(res)


n = int(input())
a = input()
m = 'NO'
for i in range(n-1):
    if a[i] != a[i+1]:
        m = 'YES'
        break
if m == 'YES':
    print(m, a[i:i+2], sep='\n')
else:
    print(m)


n = int(input())
s = input()
for i in range(n - 1):
    if s[i] != s[i + 1]:
        print('YES')
        print(s[i] + s[i + 1])
        exit()
print('NO')


from collections import defaultdict
n = int(input())
d = defaultdict(int)
s = input()
for i in s:
	d[i]+=1
for i in d.keys():
	if(d[i]<=n/2):
		print('YES')
		print(i)
		exit(0)
print('NO')


n = int(input())
s = input()
for i in range(n-1):
	if(s[i]!=s[i+1]):
		print('YES')
		print(s[i]+s[i+1])
		exit(0)
print('NO')


n = int(input())
text = input()
ans = False
for i in range(1, n):
    if text[i] != text[i-1]:
        print("YES")
        print(text[i-1:i+1])
        ans = True
        break

if not ans:
    print("NO")


n=int(input())
a=input()
for i in range(n-1):
    if (a[i]!=a[i+1]):
        print("YES")
        print(a[i]+a[i+1])
        exit(0)
print("NO")


n=int(input())
s=input();flag=0
for i in range(n):
    c=0;d={};w=''
    for j in range(i,n):
        c+=1;k=0;w+=s[j]
        if s[j] in d:
            d[s[j]]+=1
        else:
            d[s[j]]=1
        for j in d.items():
            if j[1]<=(c//2):
                k+=1
        #print (k,d)
        if k==len(d.items()):
            print ('YES')
            print (w)
            flag=1
            break
    if flag==1:
        break
if flag==0:
    print ('NO')


input()
s=input()
for i in s:
	if i != s[0]:
		print('YES\n'+s[0]+i)
		exit()
print('NO')


n = input()
s = input()
ok = False
for i in range(1,len(s)):
	if s[i] != s[i-1]:
		print('YES')
		ok=True
		print(s[i-1:i+1])
		break
if not ok:
	print('NO')


from collections import Counter
n = int(input())
s = input().strip()

def is_diverse(param):
    n = len(param)
    c = Counter(param)
    return c.most_common(1)[0][1] < (n / 2)

for i in range(n):
    for j in range(i + 1, n + 1):
        t = s[i:j]
        if is_diverse(t):
            print("YES\n" + t)
            exit()

print("NO")


n = int(input())
s = input().strip()

for i in range(n - 1):
    if s[i] != s[i + 1]:
        print("YES\n" + s[i:i + 2])
        exit()
print("NO")


from collections import Counter

n = int(input())
s = input().strip()

for size in range(2, n):
    limit = size // 2
    t = s[:size]
    c = Counter(t)
    if c.most_common(1)[0][1] <= limit:
        print("YES\n" + t)
        exit()

    for j in range(size, n):
        c[j - size] -= 1
        c[size] += 1
        if c.most_common(1)[0][1] <= limit:
            print("YES\n" + t)
            exit()
print("NO")


from collections import Counter

n = int(input())
s = input().strip()

for size in range(2, n):
    limit = size // 2
    t = s[:size]
    c = Counter(t)
    if c.most_common(1)[0][1] <= limit:
        print("YES\n" + t)
        exit()

    for j in range(size, n):
        c[s[j - size]] -= 1
        c[s[j]] += 1
        if c.most_common(1)[0][1] <= limit:
            print("YES\n" + t)
            exit()
print("NO")


input()
s = input()
for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        print("YES")
        print(s[i:i + 2])
        exit(0)
print("NO")


n = int(input())
s = input()
nDig = [[0 for i in range(ord('z') - ord('a') + 1)] for j in range(n + 1)]
for i in range(n):
    nDig[i + 1] = nDig[i][:]
    nDig[i + 1][ord(s[i]) - ord('a')] += 1
for l in range(n):
    for r in range(l, n):
        length = r - l + 1
        good = True
        for d in range(0, ord('z') - ord('a') + 1):
            if 2 * (nDig[r + 1][d] - nDig[l][d]) > length:
                good = False
                break
        if good:
            print("YES")
            print(s[l:r+1])
            exit()
print("NO")


am = int(input())
data = list(input())
for i in range(am-1):
    if data[i] != data[i+1]:
        print("YES")
        print(data[i]+data[i+1])
        break
else:
    print("NO")


am = int(input())
data = list(input())
for i in range(am-1):
    if data[i] != data[i+1]:
        print(data[i]+data[i+1])
        break
else:
    print(-1)


Input=lambda:map(int,input().split())

n = int(input())
s = input()
for i in range(n-1):
        if s[i] != s[i+1]:
                print("YES")
                print(s[i]+s[i+1])
                exit()
print("NO")


n = int(input())
s = input()
flag = 0
if n == 1:
    print('NO')
else:
    for j in range(n):
        if s.count(s[j]) > n // 2:
            print('NO')
            flag = 1
            break
    if flag == 0:
        for i in range(1, n):
            if s[i] != s[i - 1]:
                print('YES')
                print(s[i - 1] + s[i])
                break
            elif i == n - 1:
                print('NO')


n = int(input())
s = input()
if n == 1:
    print('NO')
for i in range(1, n):
    if s[i] != s[i - 1]:
        print('YES')
        print(s[i - 1] + s[i])
        break
    elif i == n - 1:
        print('NO')


n=int(input());a=input()
if len(set(a))-1:
	print('YES')
	print(a[0],end='')
	for i in range(1,n):
		if a[i]!=a[0]:exit(print(a[i]))
print('NO')


n=int(input())
l=list(input())
s=set(l)
if len(s)==1:
	print("NO")
else:
	print("YES")
	for i in range(len(l)-1):
		if l[i]!=l[i+1]:
			print(l[i]+l[i+1])
			break


n = int(input())
s = input()
found = False
i = 0
while i < n - 1 and not found:
    if (s[i] != s[i + 1]):
        print("YES")
        print(s[i], s[i + 1], sep="")
        found = True
    i += 1
if not found:
    print("NO")


n=int(input())
a=input()
for i in range(n-1):
    if a[i]!=a[i+1]:
        print('YES')
        exit(print(''.join([a[i],a[i+1]])))
print('NO')


n = int(input())
s = input()
for i in range(1, n):
    if s[i - 1] != s[i]:
        print('YES')
        print(s[i - 1:i + 1])
        break
else:
    print('NO')


#
import collections, atexit, math, sys, bisect

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        print(*args, **kwargs, file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass

inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit

N, = getIntList()
#print(N)

ss = input()

for i in range(1,N):
    if ss[i-1]!= ss[i]:
        print('YES')
        print(ss[i-1:i+1])
        sys.exit()
print('NO')


def solve():
	_ = int(input())
	s = input()
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print("YES")
			print(s[i : i + 2])
			return
	print("NO")
solve()


n = int(input())
s = input()
Flag = False
for i in range(n - 1):
    if s[i] != s[i + 1]:
        print("YES", s[i] + s[i + 1], sep = '\n')
        Flag = True
        break

if Flag == False:
    print("NO")


n=int(input())
s=input()
if(len(set(s))==1):
    print("NO")
else:
    print("YES")
    print(s[0:n-1])


n=int(input())
s=input()
if(len(set(s))==1):
    print("NO")
else:
    print("YES")
    print(s[0:2])


n=int(input())
s=input()
l=[]
for i in s:
    x=s.count(i)
    if(x<=n//2):
        l.append(i)
m=len(l)
if(m==0):
    print("NO")
else:
    print("YES")
    print(''.join(l[:m-1]))


n=int(input())
s=input()
c=0
r=''
for i in range(n-1):
    if(s[i]!=s[i+1]):
        r=r+s[i]+s[i+1]
        c=1
        print("YES")
        print(r)
        break
if(c==0):
    print("NO")


s=list(input())
if(all(e==s[0] for e in s)):
	print("NO")
else:
	print("YES")


n=int(input())
s=list(input())
if(all(s[i]==s[0] for i in range (n))):
	print("NO")
else:
	for i in range(0,n-1):
		if(s[i]!=s[i+1]):
			print("YES")
			print(s[i]+s[i+1])
			break


s=list(input())
if(all(s[i]==s[0] for i in range (len(s)))):
	print("NO")
else:
	print("YES")


s=list(input())
if(all(s[i]==s[0] for i in range (len(s)))):
	print("NO")
else:
	for i in range(0,len(s)-1):
		if(s[i]!=s[i+1]):
			print("YES")
			print(s[i]+s[i+1])
			break


def check(dr, dl, l):
    for k, v in dr.items():
        if v - dl.get(k, 0) >= l // 2:
            return False
    return True

def main():
    n = int(input())
    s = input()

    cum = [dict()]

    for c in s:
        new = cum[-1].copy()
        new[c] = new.get(c, 0) + 1
        cum.append(new)

    for i in range(n):
        for j in range(i + 1, n + 1):
            if check(cum[j], cum[i], j - i):
                print("YES")
                print(s[i:j])
                return

    print("NO")

main()


def check(dr, dl, l):
    for k, v in dr.items():
        if v - dl.get(k, 0) >= l // 2:
            return False
    print(dl, dr, l)
    return True

def main():
    n = int(input())
    s = input()

    cum = [dict()]

    for c in s:
        new = cum[-1].copy()
        new[c] = new.get(c, 0) + 1
        cum.append(new)

    for i in range(n):
        for j in range(i + 1, n + 1):
            if check(cum[j], cum[i], j - i):
                print("YES")
                print(s[i:j])
                return

    print("NO")

main()


def main():
    n = int(input())
    s = input()

    for i in range(n - 1):
        if s[i] != s[i + 1]:
            print("YES")
            print(s[i] + s[i + 1])
            return

    print("NO")

main()


def main():
    n = int(input())
    s = input()

    for i in range(n - 1):
        if s[i] != s[j]:
            print("YES")
            print(s[i] + s[j])

    print("NO")

main()


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long

#define  in(ar,n) for(int i=0;i<n;i++)cin>>ar[i]
#define in2d(ar,n,m) for(int i=0;i<n;i++)for(int i=0;i<m;i++)cin>>ar[i]
#define out(ar,n) \
    for(int i=0;i<n;i++) \
    cout<<ar[i]<<" "; \
    cout<<endl;
#define swap(a,b)\
    int t = a; \
    a = b; \
    b = t;
#define print(val) cout<<val<<endl;
#define set(ar,n,val) for(int i=0;i<n;i++)ar[i]=val
#define for2d(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define minar(ar,n,mn) for(int i=0;i<n;i++)mn =min(mn,ar[i])
#define maxar(ar,n,mx) for(int i=0;i<n;i++)mx =max(mx,ar[i])

#define rep(i,a,b) for(ll i=a;i<b;++i)

using namespace std;
typedef  pair<int, int> pi ;
typedef pair<ll,ll> pl;
typedef vector<vector<int>> vvi;

int main(){
    // int t;cin>>t;
    // while(t--){
        int n;cin>>n;
        if(n<3 || n%2==0){
            cout<<-1<<endl;
            return 0;
        }
        // int k;cin>>k;
        ll p[n],q[n],r[n];

        for(int i = 0 ;i<n;i++){
            p[i] = i;
            r[n-i-1] = i;
        }
        for(int i = 0;i<n;i++){
            q[i] = ((p[i] - r[i])%n + n)%n;
        }
        out(p,n);
        out(q,n);
        out(r,n);
        // in(ar,n);
    // }
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long

#define  in(ar,n) for(int i=0;i<n;i++)cin>>ar[i]
#define in2d(ar,n,m) for(int i=0;i<n;i++)for(int i=0;i<m;i++)cin>>ar[i]
#define out(ar,n) \
    for(int i=0;i<n;i++) \
    cout<<ar[i]<<" "; \
    cout<<endl;
#define swap(a,b)\
    int t = a; \
    a = b; \
    b = t;
#define print(val) cout<<val<<endl;
#define set(ar,n,val) for(int i=0;i<n;i++)ar[i]=val
#define for2d(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define minar(ar,n,mn) for(int i=0;i<n;i++)mn =min(mn,ar[i])
#define maxar(ar,n,mx) for(int i=0;i<n;i++)mx =max(mx,ar[i])

#define rep(i,a,b) for(ll i=a;i<b;++i)

using namespace std;
typedef  pair<int, int> pi ;
typedef pair<ll,ll> pl;
typedef vector<vector<int>> vvi;

int main(){
    // int t;cin>>t;
    // while(t--){
        int n;cin>>n;
        if(n<3 || n%2==0){
            cout<<-1<<endl;
            return 0;
        }
        // int k;cin>>k;
        ll p[n],q[n],r[n];

        for(int i = 0 ;i<n;i++){
            p[i] = i;
            r[n-i-1] = i;
        }
        for(int i = 0;i<n;i++){
            q[i] = ((r[i] - p[i])%n + n)%n;
        }
        out(p,n);
        out(q,n);
        out(r,n);
        // in(ar,n);
    // }
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long

#define  in(ar,n) for(int i=0;i<n;i++)cin>>ar[i]
#define in2d(ar,n,m) for(int i=0;i<n;i++)for(int i=0;i<m;i++)cin>>ar[i]
#define out(ar,n) \
    for(int i=0;i<n;i++) \
    cout<<ar[i]<<" "; \
    cout<<endl;
#define swap(a,b)\
    int t = a; \
    a = b; \
    b = t;
#define print(val) cout<<val<<endl;
#define set(ar,n,val) for(int i=0;i<n;i++)ar[i]=val
#define for2d(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define minar(ar,n,mn) for(int i=0;i<n;i++)mn =min(mn,ar[i])
#define maxar(ar,n,mx) for(int i=0;i<n;i++)mx =max(mx,ar[i])

#define rep(i,a,b) for(ll i=a;i<b;++i)

using namespace std;
typedef  pair<int, int> pi ;
typedef pair<ll,ll> pl;
typedef vector<vector<int>> vvi;

int main(){
    // int t;cin>>t;
    // while(t--){
        int n;cin>>n;
        if( n%2==0){
            cout<<-1<<endl;
            return 0;
        }
        // int k;cin>>k;
        ll p[n],q[n],r[n];

        for(int i = 0 ;i<n;i++){
            p[i] = i;
            r[n-i-1] = i;
        }
        for(int i = 0;i<n;i++){
            q[i] = ((r[i] - p[i])%n + n)%n;
        }
        out(p,n);
        out(q,n);
        out(r,n);
        // in(ar,n);
    // }
}


///There is No God Besides Allah, Hazrat Muhammad (SAW) is the Messenger of Allah

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")//Use for fast code excutaion.
#pragma GCC target("avx,avx2,fma")

using namespace std;

#define _FIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define _FI ios::sync_with_stdio(0);cin.tie(NULL);

#define all(v) (v).begin(),(v).end()
#define pall(v,n) (v).begin(),(v).begin()+n // partial traverse er jonno
#define rall(v) reverse(all(v))
#define S(v) sort(all(v))
#define Sp(v,n) sort(pall(v,n))
#define Rs(v) sort(all(v),greater<int>())//Reverse Sort korar jonno
#define f(i,s,e) for(int i=s;i<e;i++)
#define r(i,e,s) for(int i=e;i>=s;i--)
#define fi(it,v) for(auto it=v.begin();it!=v.end();++it)
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),v.end())
#define mi(v) *min_element(all(v))
#define ma(v) *max_element(all(v))
#define fup(v,n) fill(all(v),n)//one dimensilonal
#define fup(v,x,y,n) fill(v[0],v[0]+(x*y),n)//Two dimensional array fill korar jonno;
#define cnt(v,x) count(all(v),x)
#define b_s(v,n,x) binary_search(pall(v,n),x)
#define per next_permutation
int x;

#define sin(v,n)    for(int i=0;i<n;i++){cin>>x;v.insert(x);}
#define vin(v)      for(auto &x: v){cin>>x;}
#define ain(a,n)    f(i,0,n)cin>>a[i]
#define out(v)      {for(auto &x: v){cout<<x<<" ";}cout<<endl;}

#define point(x)    fixed<<setprecision(x)/// To add point at fixed position.
#define lcm(a,b)    (a*b)/__gcd(a,b)// lcm ber korar jonno
#define en "\n"

#define pb push_back
#define pf push_front
#define p_b pop_back
#define p_f pop_front
#define ff first
#define se second

const double pi = acos(-1.0);
const int mod=1000000007;///1e9+7 fixed;
const int maxn = 2000010;/// Max size of array;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef set<ll> St;
typedef multiset<ll> MSt;
typedef map<ll,ll> M;
typedef pair<int,int> P;

//Test Case:
int t = 0;
int n;//default number;
#define TC(t) if(t==0){slove();}else{while(t--){slove();}}

int ceil(int n)
{
  int x = n/9;
  if(x*9==n)
    return x;
  else
    return x+1;
}
bool cmmm(const P &a, const P &b)
{
  return (a.second>b.second);
}
ll b_p(ll a,ll n)
{
    ll ans = 1;
    while(n>0)
    {
        if(n&1)
        {
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        n/=2;
    }
    return ans;
}
void slove()
{

  int n;
  cin>>n;
  if(n%2==0)
    cout<<-1<<en;
  else
  {
    f(i,0,n)
    {
      cout<<(i+i)%n<<" ";
    }
    cout<<en;
  }
}
int main()
{

   // _FI;
   // cin>>t;
   TC(t);

}
///ALHAMDULILLAH

///Source_C0de-Fahim Shahriar


///There is No God Besides Allah, Hazrat Muhammad (SAW) is the Messenger of Allah

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")//Use for fast code excutaion.
#pragma GCC target("avx,avx2,fma")

using namespace std;

#define _FIO ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define _FI ios::sync_with_stdio(0);cin.tie(NULL);

#define all(v) (v).begin(),(v).end()
#define pall(v,n) (v).begin(),(v).begin()+n // partial traverse er jonno
#define rall(v) reverse(all(v))
#define S(v) sort(all(v))
#define Sp(v,n) sort(pall(v,n))
#define Rs(v) sort(all(v),greater<int>())//Reverse Sort korar jonno
#define f(i,s,e) for(int i=s;i<e;i++)
#define r(i,e,s) for(int i=e;i>=s;i--)
#define fi(it,v) for(auto it=v.begin();it!=v.end();++it)
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),v.end())
#define mi(v) *min_element(all(v))
#define ma(v) *max_element(all(v))
#define fup(v,n) fill(all(v),n)//one dimensilonal
#define fup(v,x,y,n) fill(v[0],v[0]+(x*y),n)//Two dimensional array fill korar jonno;
#define cnt(v,x) count(all(v),x)
#define b_s(v,n,x) binary_search(pall(v,n),x)
#define per next_permutation
int x;

#define sin(v,n)    for(int i=0;i<n;i++){cin>>x;v.insert(x);}
#define vin(v)      for(auto &x: v){cin>>x;}
#define ain(a,n)    f(i,0,n)cin>>a[i]
#define out(v)      {for(auto &x: v){cout<<x<<" ";}cout<<endl;}

#define point(x)    fixed<<setprecision(x)/// To add point at fixed position.
#define lcm(a,b)    (a*b)/__gcd(a,b)// lcm ber korar jonno
#define en "\n"

#define pb push_back
#define pf push_front
#define p_b pop_back
#define p_f pop_front
#define ff first
#define se second

const double pi = acos(-1.0);
const int mod=1000000007;///1e9+7 fixed;
const int maxn = 2000010;/// Max size of array;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef set<ll> St;
typedef multiset<ll> MSt;
typedef map<ll,ll> M;
typedef pair<int,int> P;

//Test Case:
int t = 0;
int n;//default number;
#define TC(t) if(t==0){slove();}else{while(t--){slove();}}

int ceil(int n)
{
  int x = n/9;
  if(x*9==n)
    return x;
  else
    return x+1;
}
bool cmmm(const P &a, const P &b)
{
  return (a.second>b.second);
}
ll b_p(ll a,ll n)
{
    ll ans = 1;
    while(n>0)
    {
        if(n&1)
        {
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        n/=2;
    }
    return ans;
}
void slove()
{

  int n;
  cin>>n;
  if(n%2==0)
    cout<<-1<<en;
  else
  {
    int a[n],b[n];
    f(i,0,n)
    {
      cout<<i<<" ";
      a[i]=i;
    }
    cout<<en;
    f(i,0,n)
    {
      cout<<i<<" ";
      b[i]=i;
    }
    cout<<en;
    f(i,0,n)
    {
      cout<<(i+i)%n<<" ";
    }
    cout<<en;
  }
}
int main()
{

   // _FI;
   // cin>>t;
   TC(t);

}
///ALHAMDULILLAH

///Source_C0de-Fahim Shahriar


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

int main()
{
    int n;
    cin >> n;
    if (n & 1) {
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << i;
        }
        cout << "\n";
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << i;
        }
        cout << "\n";
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << i;
        }
        cout << "\n";
    }
    else puts("-1");
}


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

int main()
{
    int n;
    cin >> n;
    if (n & 1) {
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << i;
        }
        cout << "\n";
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << i;
        }
        cout << "\n";
        for (int i = 0; i < n; i++) {
            if (i > 0) cout << " ";
            cout << (i + i)%n;
        }
        cout << "\n";
    }
    else puts("-1");
}


#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define fo(i,x,n) for(ll i=x;i<n;i++)
#define MAX(a,b,c) = max(a,max(b,c))
#define ull usigned long long int
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 int MOD = 1e9+7;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

ll gcd(ll a, ll b){
    if(a == 0){
        return b;
    }
    return gcd(b % a, a);
}

ll powx(ll n, ll p){
    ll res = 1;
    while(p){
        if(p & 1){
            res = (res * n) % MOD;
            --p;
        }
        else{
            n = (n * n) % MOD;
            p /= 2;
        }
    }
    return res;
}
ll cmp(ll a,ll b)
{
    return a>= b;
}
void tc()
{
    ll n;
    cin >> n;
    if(n%2==0)
    {
        cout << -1 << endl;
    }
    else
    {
        fo(i,1,n+1)
        {
            cout << i << " ";
        }
        cout << endl;
        fo(i,1,n+1)
        {
            cout << i << " ";
        }
        cout << endl;
        fo(i,1,n+1)
        {
            if((2*i)%n)
            cout << (2*i)%n << " ";
            else
            cout << n << " ";
        }
        cout << endl;
    }

}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll t;
    t = 1;
  // cin >> t;
    while(t--)
    {
       tc();
    }

}


#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define fo(i,x,n) for(ll i=x;i<n;i++)
#define MAX(a,b,c) = max(a,max(b,c))
#define ull usigned long long int
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 int MOD = 1e9+7;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

ll gcd(ll a, ll b){
    if(a == 0){
        return b;
    }
    return gcd(b % a, a);
}

ll powx(ll n, ll p){
    ll res = 1;
    while(p){
        if(p & 1){
            res = (res * n) % MOD;
            --p;
        }
        else{
            n = (n * n) % MOD;
            p /= 2;
        }
    }
    return res;
}
ll cmp(ll a,ll b)
{
    return a>= b;
}
void tc()
{
    ll n;
    cin >> n;
    if(n%2==0)
    {
        cout << -1 << endl;
    }
    else
    {
        fo(i,1,n+1)
        {
            cout << i-1 << " ";
        }
        cout << endl;
        fo(i,1,n+1)
        {
            cout << i-1 << " ";
        }
        cout << endl;
        fo(i,1,n+1)
        {

            cout << (2*(i-1))%n << " ";

        }
        cout << endl;
    }

}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll t;
    t = 1;
  // cin >> t;
    while(t--)
    {
       tc();
    }

}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll mininf = -922337203685477;
const ll nax = 1e5 + 5;

ll n;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(); cout.tie();

	cin >> n;
	if(n % 2 == 0 && n < 3){
		cout << -1 << '\n';
		return 0;
	}
	else{
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << (i + i) % n << " ";
		}
		cout << '\n';
	}
}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll mininf = -922337203685477;
const ll nax = 1e5 + 5;

ll n;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(); cout.tie();

	cin >> n;
	if(n % 2 == 0 || n < 3){
		cout << -1 << '\n';
		return 0;
	}
	else{
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << (i + i) % n << " ";
		}
		cout << '\n';
	}
}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll mininf = -922337203685477;
const ll nax = 1e5 + 5;

ll n;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(); cout.tie();

	cin >> n;
	if(n % 2 == 0){
		cout << -1 << '\n';
		return 0;
	}
	else{
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << i << " ";
		}
		cout << '\n';
		for(ll i = 0; i < n; i++){
			cout << (i + i) % n << " ";
		}
		cout << '\n';
	}
}


#include <bits/stdc++.h>
#include <stdio.h>
#include <cstdio>
#include <unordered_map>

#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define clr(a,b) memset(a,b,sizeof a)
#define fr first
#define sc second
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;

	if (n % 2 == 0 || n == 1) {
		cout << -1 << endl;
		return 0;
	}
	for (int i = 0; i < n; ++i) {
		cout << i << " ";
	}
	cout << endl;

	for (int i = 2; i < n; ++i) {
		cout << i << " ";
	}
	cout << 0 << " " << 1 << endl;
	int c = 2;
	for (int i = 0; i < n; ++i) {
		cout << c << " ";
		c = (c + 2) % n;
	}

	return 0;
}


#include <bits/stdc++.h>
#include <stdio.h>
#include <cstdio>
#include <unordered_map>

#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define clr(a,b) memset(a,b,sizeof a)
#define fr first
#define sc second
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;

	if (n % 2 == 0) {
		cout << -1 << endl;
		return 0;
	}
	if (n == 1) {
		cout << "0 \n0\n0" << endl;
		return 0;
	}
	for (int i = 0; i < n; ++i) {
		cout << i << " ";
	}
	cout << endl;

	for (int i = 2; i < n; ++i) {
		cout << i << " ";
	}
	cout << 0 << " " << 1 << endl;
	int c = 2;
	for (int i = 0; i < n; ++i) {
		cout << c << " ";
		c = (c + 2) % n;
	}

	return 0;
}


#include <bits/stdc++.h>
#include <stdio.h>
#include <cstdio>
#include <unordered_map>

#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define clr(a,b) memset(a,b,sizeof a)
#define fr first
#define sc second
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;

	if (n % 2 != 0) {
		for (int i = 0; i < n; ++i) {
			cout << i << " ";
		}
		cout << endl;

		for (int i = 2; i < n; ++i) {
			cout << i << " ";
		}
		cout << 0 << " " << 1 << endl;
		int c = 2;
		for (int i = 0; i < n; ++i) {
			cout << c << " ";
			c = (c + 2) % n;
		}
	} else {
		cout << -1 << endl;

	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,x,y,z;
pair<ll,pair<ll,ll>>a[100000];
map<ll,ll>m1;
map<ll,ll>m2;
int main()
{
    cin>>n;

    ll k=0;
    for(int i=0;i<n;i++)
    {
        for(int q=0;q<n;q++)
        {
            x=i;
            y=q;
            z=(x+y)%n;
            if(z<n&&m1[y]==0&&m2[z]==0)
            {
                a[k].first=x;
                a[k].second.first=y;
                a[k].second.second=z;
                m1[y]++;
                m2[z]++;
                k++;
                break;
            }
        }
    }
    if(k<n)
    {
         cout<<"-1";
        return 0;
    }
    for(int i=0;i<n;i++)
        cout<<a[i].first<<" ";
        cout<<endl;
    for(int i=0;i<n;i++)
        cout<<a[i].second.first<<" ";
        cout<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i].second.second<<" ";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,x,y,z;
pair<ll,pair<ll,ll>>a[100000];
map<ll,ll>m1;
map<ll,ll>m2;
int main()
{
    cin>>n;

    ll k=0,j=0;
    for(int i=0;i<n;i++)
    {
        for(int q=j;q<n;q++)
        {
            x=i;
            y=q;
            z=(x+y)%n;
            if(z<n&&m2[z]==0)
            {
                j=q+1;
                a[k].first=x;
                a[k].second.first=y;
                a[k].second.second=z;
                m2[z]++;
                k++;
                break;
            }
        }
        if(k==n)break;
    }
    if(k<n)
    {
         cout<<"-1";
        return 0;
    }
    for(int i=0;i<n;i++)
        cout<<a[i].first<<" ";
        cout<<endl;
    for(int i=0;i<n;i++)
        cout<<a[i].second.first<<" ";
        cout<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i].second.second<<" ";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,x,y,z;
pair<ll,pair<ll,ll>>a[100000];
map<ll,ll>m1;
map<ll,ll>m2;
int main()
{
    cin>>n;
    if(n<3)
    {
        cout<<"-1";
        return 0;
    }
    ll k=0;
    for(int i=0;i<n;i++)
    {
        for(int q=0;q<n;q++)
        {
            x=i;
            y=q;
            z=(x+y)%n;
            if(z<n&&m1[y]==0&&m2[z]==0)
            {
                a[k].first=x;
                a[k].second.first=y;
                a[k].second.second=z;
                m1[y]++;
                m2[z]++;
                k++;
                break;
            }
        }
    }
    if(k<n)
    {
         cout<<"-1";
        return 0;
    }
    for(int i=0;i<n;i++)
        cout<<a[i].first<<" ";
        cout<<endl;
    for(int i=0;i<n;i++)
        cout<<a[i].second.first<<" ";
        cout<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i].second.second<<" ";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,x,y,z;
pair<ll,pair<ll,ll>>a[100000];
map<ll,ll>m1;
map<ll,ll>m2;
int main()
{
    cin>>n;
    if(n<3)
    {
        cout<<"-1";
        return 0;
    }
    ll k=0;
    for(int i=0;i<n;i++)
    {
        for(int q=0;q<n;q++)
        {
            x=i;
            y=q;
            z=(x+y)%n;
            if(z<n&&m1[y]==0&&m2[z]==0)
            {
                a[k].first=x;
                a[k].second.first=y;
                a[k].second.second=z;
                m1[y]++;
                m2[z]++;
                k++;
                break;
            }
        }
    }
    for(int i=0;i<n;i++)
        cout<<a[i].first<<" ";
        cout<<endl;
    for(int i=0;i<n;i++)
        cout<<a[i].second.first<<" ";
        cout<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i].second.second<<" ";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,x,y,z;
pair<ll,pair<ll,ll>>a[100000];
map<ll,ll>m;
int main()
{
    cin>>n;
    if(n<3)
    {
        cout<<"-1";
        return 0;
    }
    ll k=0;
    for(int i=0;i<n;i++)
    {
        for(int q=1;q<n;q++)
        {
            x=i;
            y=q;
            if(x+y==(x+y)%n&&m[x+y]==0||x+y==n)
            {
                a[k].first=x;
                a[k].second.first=y;
                z=x+y;
                if(x+y==n) z=z%n;
                a[k].second.second=z;
                m[x+y]++;
                k++;
            }

        }
    }
    for(int i=0;i<n;i++)
        cout<<a[i].first<<" ";
        cout<<endl;
    for(int i=0;i<n;i++)
        cout<<a[i].second.first<<" ";
        cout<<endl;
        for(int i=0;i<n;i++)
        cout<<a[i].second.second<<" ";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
ll n,a[100000],x,y,z;
map<ll,ll>m;
int main()
{
    cin>>n;
    if(n<3)
    {
        cout<<"-1";
        return 0;
    }
    for(int i=0;i<n;i++)
    {
        for(int q=1;q<n;q++)
        {
            x=i;
            y=q;
            if(x+y==(x+y)%n&&m[x+y]==0)
            {
                cout<<x<<endl<<y<<endl<<x+y<<endl;
                m[x+y]++;
            }

        }
    }
    return 0;
}


 #include <iostream>
using namespace std;
#include <algorithm>
#include <cmath>
#include<set>
#include<unordered_set>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<iomanip>
#include<map>

int main(){
 ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   int n;cin>>n;
 int a1[n],a2[n],a3[n];
 if(n==1||n==2){cout<<"-1"<<endl;return 0;}
 int j= n -1 ;
 for(int i=0;i<n;i++){a1[i]=i;a2[i]=j;a3[i]=(a1[i]+a2[i])%n;j--;}
 for(int i=0;i<n;i++)
 {
      cout<<a1[i]<<" ";
 }
 cout<<endl;
  for(int i=0;i<n;i++)
 {
      cout<<a2[i]<<" ";
 }
 cout<<endl;
  for(int i=0;i<n;i++)
 {
      cout<<a3[i]<<" ";
 }

}


 #include <iostream>
using namespace std;
#include <algorithm>
#include <cmath>
#include<set>
#include<unordered_set>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<iomanip>
#include<map>

int main(){
 ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     int n =0 ;
    cin>>n;
    if(  n%2 ==0){cout<<-1;return 0;}
    else {
        int arr1[n];
        int arr2[n];
        int arr3[n];
        for (int i = 0; i < n; i++) { arr1[i] = i; }
        for (int i = 0; i < n; i++) { cout << arr1[i] << " "; }
        cout << endl;
        for (int i = 0, j = 1; j < (n); i++, j++) { arr2[i] = j; }
        arr2[n - 1] = 0;
        for (int i = 0; i < n; i++) { cout << arr2[i] << " "; }
        cout << endl;
        for (int i = 0; i < n; i++) { arr3[i] = (((arr1[i] + arr2[i]) % n)); }
        for (int i = 0; i < n; i++) { cout << arr3[i] << " "; }
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;

void solve() {
    int n;
    cin >> n;

    if(n % 2 == 0)cout<< -1;
    else {
        for(int i = 0; i < n; i++)cout << i << " ";
        cout << endl;
        for(int i = 0; i < n; i++)cout << i << " ";
        cout << endl;
        for(int i = 0; i < n; i++)cout << (2 * i) % n << " ";
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;;
    cin >> n;

    if (n & 1) {
        for (int i = 0; i < n; i++)
            cout << i << " ";
        cout << endl;
        for (int i = 0; i < n; i++)
            cout << i << " ";
        cout << endl;
        for (int i = 0; i < n; i++)
            cout << (2 * i) % n << " " << endl;
    } else {
        cout << -1 << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;;
    cin >> n;

    if (n & 1) {
        for (int i = 0; i < n; i++)
            cout << i << " ";
        cout << endl;
        for (int i = 0; i < n; i++)
            cout << i << " ";
    } else {
        cout << -1 << endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
    cin >> n;
    if (n % 2)
    {

    for (int i = 0; i < n; i++)
    {
        cout << i << " ";
    }
    cout << endl;
    for (int i = 1; i <= n; i++)
    {
        cout << i % n << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++)
    {
        cout << (i + (i + 1) % n)%n << " ";
    }
    cout << endl;
    }
    else
    {
        cout << -1 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    if (n%2==0) return cout << -1 << endl,0;
    vector<int> a(n),b(n),c(n);
    for (int i=0,j=n-1 ; i<n ; i++,j--)
        a[i]=i,c[i]=j;
    for (int i=0 ; i<n ; i++)
    {
        !c[i] ? b[i]=n-a[i] : b[i]=c[i]-a[i];
        if (b[i]==n) b[i]=0;
        if(b[i]<0)
            b[i]+=n;
    }
    for (auto i:a)
        cout << i << ' ';
    cout << endl;
    for (auto i:b)
        cout << i << ' ';
    cout << endl;
    for (auto i:c)
        cout << i << ' ';
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    if (n%2==0) return cout << -1 << endl,0;
    vector<int> a(n),b(n),c(n);
    for (int i=0,j=n-1 ; i<n ; i++,j--)
        a[i]=i,c[i]=j;
    for (int i=0 ; i<n ; i++)
    {
        !c[i] ? b[i]=n-a[i] : b[i]=c[i]-a[i];
        if(b[i]<0)
            b[i]+=n;
    }
    for (auto i:a)
        cout << i << ' ';
    cout << endl;
    for (auto i:b)
        cout << i << ' ';
    cout << endl;
    for (auto i:c)
        cout << i << ' ';
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cout << i << " ";
    }
    cout << endl;
    for (int i = 1; i <= n; i++)
    {
        cout << i % n << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++)
    {
        cout << (i + (i + 1) % n)%n << " ";
    }
    cout << endl;
    return 0;
}