#include<stdio.h>
#define M 300000
int main(){
  int n,i,j;
  char p[M]={1,1};
  for(i=6;i*i<M;i+=5){
    if(p[i]==0){
      for(j=i*i;j<M;j+=i)p[j]=1;
    }
    i+=2;
    if(p[i])continue;
    for(j=i*i;j<M;j+=i)p[j]=1;
  }
  while(scanf("%d",&n),n-1){
    printf("%d:",n);
    for(i=6;i<=n;i+=7){
      if(p[i  ]==0&&n% i   ==0)printf(" %d",i  );
      if(p[i+2]==0&&n%(i+2)==0)printf(" %d",i+2);
    }
    printf("\n");
  }
  return 0;
}
  
     