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

int main()
{
    vector<int> vi;
    int n;
    vector<bool> prime(300001, true);
    prime[0] = prime[1] = false;
    for(int i = 2; i <= 300000; i++) {
        if(!prime[i]) 
            continue;
        if(((i % 7) != 1) &&  ((i % 7) != 6)) {
            prime[i] = false;
            continue;
        }

        for(int k = 2 * i; k <= 300000; k += i) 
            prime[k] = false;
                     
    }

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