#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  i64 limit = 300000;
  vector<i64> prime(limit, 0);
  i64 num[] = {1, 6};
  vector<i64> ps;
  for(i64 i = 0, j = 1; i * 7 + num[j] < limit; i += j, j ^= 1) {
    i64 n = i * 7 + num[j];
    if(prime[n] == 0) {
      prime[n] = 1;
      ps.push_back(n);
      for(i64 p = 0, q = 1; n * (p * 7 + num[q]) < limit; p += q, q ^= 1) {
        prime[n * (p * 7 + num[q])] = -1;
      }
    }
  }
  i64 n;
  while(cin >> n, n != 1) {
    cout << n << ":";
    for(auto x: ps) {
      if(n % x == 0) {
        cout << " " << x;
      }
    }
    cout << endl;
  }
}

