#include <iostream>
#include <vector>

using namespace std;

int main()
{
	vector<int> mss;
	for(int i=0;i<500000;i+=7){
		mss.push_back(i+1);
		mss.push_back(i+6);
	}
	vector<int> msps;
	for(int i=1;i<mss.size();i++){
		bool ismsp=true;
		for(int j=0;j<msps.size() && msps[j]*msps[j]<=mss[i];j++){
			if(mss[i]%msps[j]==0)
				ismsp=false;
		}
		if(ismsp)
			msps.push_back(mss[i]);
	}
	
	for(int n;cin>>n,n!=1;){
		cout<<n<<":";
		for(int i=0;i<msps.size();i++)
			if(n%msps[i]==0)
				cout<<" "<<msps[i];
		cout<<endl;
	}
	
	return 0;
}