int main()                                    //?????
{                      
	int i;                                    //??????i
	cin >>i;                                  //????i
	if(i%3==0)                                //??i?????
	{
		if(i%5==0)                            //??i??5??
		{
			if(i%7==0)                        //??i??7??
			{
				cout <<"3 5 7"<<endl;         //??3 5 7
			}
			else cout<<"3 5"<<endl;           //????3 5
		}
		else                                  //??i???5??
			if(i%7==0)                        //??i??7??
				cout <<"3 7"<<endl;           //??3 7
			else cout<<"3"<<endl;             //????3
	}
	else                                      //??i???3??
		if(i%5==0)                            //??i??5??
		{
			if(i%7==0)                        //??i??7??
			{
				cout <<"5 7"<<endl;           //??5 7
			}
		    else cout<< "5"<<endl;            //????5
		} 
		else                                  //??i???5??
			if(i%7==0)                        //??i??7??
				cout<<"7"<<endl;              //??7
			else cout<<"n"<<endl;             //????n
	return 0;                                 //????????????????????  
}