import std.stdio,std.conv, std.algorithm, std.container,std.array,std.range,std.string,std.typecons,std.numeric,std.math,std.random;
const dx = [1,0,-1,0], dy = [0,1,0,-1];
const readMixin = q{ auto line = readln().split();foreach(i,ref arg; args){ if (i >= line.length) return;arg = line[i].to!(typeof(arg));}};
void read(T...)  (auto ref T args){mixin(readMixin);}
void readArray(T)(auto ref T args){mixin(readMixin);}
int  read(){int n;read(n);return n;}
void times(int n,void delegate() stmt){foreach(i;iota(n))stmt();}
void main(){
	int[] MS;
	for(int i = 6;i < 300000;i +=7)MS ~=[i,i+2];
	int n ;
	while(read(n),n!=1){
		write(n,":");
		int[] res;
		foreach(ms;MS){
			if(ms > n) break;
			if(n % ms == 0) {
				if(!res.any!(a => ms % a == 0)) res ~= ms;
			}
		}
		res.each!(a=> write(" ",a));
		writeln();
	}
}