#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

int p[300010];
int prime[300010],pcnt;

//間に合う？
int main(){
	for(int i=6,mmm=5;i<300005;i+=mmm^=7)if(!p[i]){
		prime[pcnt++]=i;
		for(int j=6,nnn=5;i*j<300005;j+=nnn^=7)p[i*j]=1;
	}
	ll n;
	while(scanf("%lld",&n),n!=1){
		printf("%lld:",n);
		rep(i,0,pcnt){
			if(prime[i]>n)break;
			if(n%prime[i]==0)printf(" %lld",prime[i]);
		}
		puts("");
	}
}
