#include<stdio.h>

int main(){
	int number[100000];
	int prime[100000];
	int x;
	int i,j;
	for(i=0; i<50000; i++){
		number[i*2] = i*7+1;
		number[i*2+1] = i*7+6;
	}
	int primes = 1;
	prime[0]=number[1];
	for(i=2; i<100000; i++){
		for(j=0; j<primes; j++){
			if(number[i] % prime[j] == 0) break;
			else if(primes-j == 1){
				prime[primes] = number[i];
				primes++;
			}
		}
	}
	while(1){
		scanf("%d", &x);
		if(x == 1) return 0;
		printf("%d:",x);
		for(i=0; i<primes; i++){
			if(x%prime[i]==0){
				printf(" %d", prime[i]);
			}
		}
		printf("\n");
	}
	return 0;
}