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

bool check(int arg){
    int count=0;
    for(int i=2;i*i<=arg;i++){
        if(arg%i==0){
            if(i%7==1 || i%7 == 6){
                count++;
            }
            if((arg/i)%7 == 1 || (arg/i)%7 == 6){
                count++;
            }
        }
        if(count>1) return false;
    }
    return true;
}

int main(){
    int n;
    while(cin >> n && n != 1){
        vector<int> v;
        for(int i=1;i*i<=n;i++){
            if(n%i==0){
                if(i%7 == 1 || i%7 == 6){
                    if(check(i) && i != 1 && i*i != n){
                        v.push_back(i);
                    }
                }
                if((n/i)%7 == 1 || (n/i)%7==6){
                    if(check(n/i)){
                        v.push_back(n/i);
                    }
                }
            }
        }
        sort(v.begin(), v.end());

        printf("%d:", n);
        for(int i=0;i<v.size();i++){
            printf(" %d", v[i]);
        }
        printf("\n");
    }
}