#include <stdio.h>
#define N 300001
int c[N], p[N], pc;
int main(void)
{
    int i, j, n;
    for(i=6;i<N;i+=(i%7==1)?5:2) if (!c[i]) {
        p[pc++]=i;
        for(j=i+i;j<N;j+=i) c[j]=1;
    }

    while (scanf("%d", &n), n-1) {
        printf("%d:", n);
        for(i=0;i<pc;++i) if (n%p[i]==0) printf(" %d", p[i]);
        puts("");
    }
    return 0;
}