#include <iostream>

using namespace std;

int main(){
	int n = 8, size = 1;
	int MSP[100000]; MSP[0] = 6;
	while(n < 300000){
		bool flag = true;
		for(int i=0;MSP[i]*MSP[i]<=n&&i<size;i++){
			if(n%MSP[i]==0) { flag = false; break; }
		}
		if(flag) { MSP[size++] = n; }
		n += 5;
		flag = true;
		for(int i=0;MSP[i]*MSP[i]<=n&&i<size;i++){
			if(n%MSP[i]==0) { flag = false; break; }
		}
		if(flag) { MSP[size++] = n; }
		n += 2;
	}
	while(true){
		cin >> n;
		if(n==1) break;
		cout << n << ":";
		for(int i=0;i<size;i++){
			if(n%MSP[i]==0) cout << " " << MSP[i];
		}
		cout << endl;
	}
}