// Aizu 1154: Monday-Saturday Prime Factors
// 2017.9.13 bal4u@uu
// 2017.12.22

#include <stdio.h>

#define MAX 300000

char mk[MAX+2];
int tbl[35815], sz;

int main()
{
	int n, i, j;
	int *tp;
	
	for (i = 7; i <= MAX; i += 7) mk[i-1] = mk[i+1] = 1;
	for (i = 0; i <= MAX; i++) if (mk[i] && i <= 547) {		// 547 = sqrt(300000)
		for (j = i*i; j <= MAX; j+=i) mk[j] = 0;
	}

	sz = 0;
	for (i = 1; i <= MAX; i++) if (mk[i]) tbl[sz++] = i;
	tbl[sz] = 0x7ffffff;
	
	while (scanf("%d", &n) && n > 1) {
		printf("%d:", n);
		for (tp = tbl; *tp <= n; tp++) if (n % *tp == 0) printf(" %d", *tp);
		putchar('\n');
	}
	return 0;
}