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

int p[300010];
ll a[600],acnt;
ll b[600],bcnt;

int main(){
	p[1]=1;
	for(int i=6,mmm=5;i<300005;i+=mmm^=7)if(!p[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){
		acnt=bcnt=0;
		printf("%lld:",n);
		for(int i=1,mmm=2;i*i<=n;i+=mmm^=7)if(n%i==0){
			if(i*i!=n&&!p[i])a[acnt++]=i;
			if(!p[n/i])b[bcnt++]=n/i;
		}
		rep(i,0,acnt)printf(" %lld",a[i]);
		rep(i,0,bcnt)printf(" %lld",b[bcnt-1-i]);
		puts("");
	}
}
