#include <iostream>
using namespace std;

#define MAX 300100

bool isPrime[MAX];

int main() {
	fill(isPrime, isPrime + MAX, true);
	isPrime[0] = false;
	for (int i = 2; i < MAX; i++) {
		if (i % 7 != 1 && i % 7 != 6) continue;
		if (isPrime[i]) {
			for (int j = 2 * i; j < MAX; j += i) {
				isPrime[j] = false;
			}
		}
	}

	int n;
	while (cin >> n , n != 1) {
		cout << n << ":";
		for (int i = 6; i <= n; i++) {
			if (i % 7 != 1 && i % 7 != 6) continue;
			if (n % i == 0 && isPrime[i]) {
				cout << " " << i ;
			}
		}

		cout << endl;
	}

}