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

int msprime[20000],size;

bool isMSPrime(int x){
	for(int i=0;i<size && msprime[i]<=sqrt(x);i++){
		if(x % msprime[i] == 0) return false;
	}
	return true;
}

void mkMSPrime(void){
	int i,j;

	msprime[0] = 6;
	size = 1;

	for(i=8,j=0;i<=150100;j++){
		if(isMSPrime(i)) msprime[size++] = i;
		if(j%2==0) i+=5;
		else i+=2;
	}
}

int main(void){
	int i,x,count;

	mkMSPrime();

	while(cin>>x && x!=1){
		cout<<x<<":";
		for(i=count=0;msprime[i]<=x/2;i++){
			if(x % msprime[i] == 0){
				cout<<" "<<msprime[i];
				count++;
			}
		}
		if(count==0) cout<<" "<<x;
		cout<<endl;
	}

	return 0;
}