#include <bits/stdc++.h>

using namespace std;

#define N 300000

int main() {
	bool mpr[N] = {0};
	for(int i = 0; i < N; i++) {
		if(i%7 == 1 or i%7 == 6) {
			mpr[i] = 1;
		}
	}
	for(int i = 2; i < N; i++) {
		if(mpr[i]) {
			for(int j = i*2; j < N; j += i)
				mpr[j] = 0;
		}
	}

	int n;
	while(cin >> n && n != 1) {
		cout << n << ":";
		for(int i = 2; i < N; i++) {
			if(mpr[i] && n%i == 0)
				cout << " " << i;
		}
		cout << endl;
	}
	return 0;
}