#include<stdio.h>
#include<stdlib.h>
int ms[300001]={0,1},i,j,N;
int main()
{
	for(i=6;i<=300001;i++)
		if((i%7==1||i%7==6)&&ms[i]!=-1)
		{
			ms[i]=1;
			for(j=i*2;j<300001;j+=i)
				ms[j]=-1;
		}
	for(;scanf("%d",&N),N!=1;)
	{
		printf("%d:",N);
		for(i=2;i<=N;i++)
			if(ms[i]==1&&N%i==0&&ms[N/i]!=0)
				printf(" %d",i);
		puts("");
	}
	return 0;
}