#include <stdio.h>
#include <math.h>

int main(void){
    int tg,i,j,n,l[300001]={0},c=0;
    for(i=2;i<300001;i++){
        if(i%7==1 | i%7==6){
            l[c]=i; 
            c++;
        }
    }
    for(i=0;i<(int)(sqrt(c));i++){
        if(!l[i]){continue;}
        for(j=i+1;j<c;j++){
            if(!(l[j]%l[i])){l[j]=0;}
        }
    }

    while(1){
        scanf("%d",&tg);
        if(tg==1){break;}
        printf("%d:",tg);
        for(i=0;i<c;i++){
            if(l[i] && !(tg%l[i])){printf(" %d",l[i]);}
        }
        printf("\n");
    }
    return 0;
}
    
            

