#include<cstdio>
#include<vector>
using namespace std;

int main() {
	int n;
	while (scanf("%d", &n), n != 1) {
		vector<int>factor;
		printf("%d:", n);
		for (int i = 1; i * 7 - 1 <= n; i++) {
			if (n % (i * 7 - 1) == 0)factor.push_back(i * 7 - 1);
			if (n % (i * 7 + 1) == 0)factor.push_back(i * 7 + 1);
		}
		for (int i = 0; i < factor.size(); i++) {
			bool is_prime = true;
			for (int j = 0; j < i; j++) {
				if (factor[i] % factor[j] == 0) {
					is_prime = false;
					break;
				}
			}
			if(is_prime)printf(" %d", factor[i]);
		}
		printf("\n");
	}
}