#include <iostream>
#include <algorithm>
#include <vector>
#define X_MAX 300001
using namespace std;
 
bool isMSP[X_MAX];
vector<int> msp;
 
void make() {
  bool flag = true;
  fill(isMSP, isMSP+X_MAX, true);
  for(int i = 0; i <= 5; ++i) isMSP[i] = false;
  for(int i = 6; i < X_MAX; i += (flag) ? 2 : 5, flag = !flag) {
    if(!isMSP[i]) continue;
    msp.push_back(i);
    for(int j = i*2; j < X_MAX; j += i) isMSP[j] = false;
  }
}
 
void solve(int x) {
  cout << x << ":";
  for(int i = 0; i < msp.size() && msp[i] <= x ; ++i) {
    if(x % msp[i] == 0) cout << " " << msp[i];
  }
  cout << endl;
}
 
int main() {
  int x;
  make();
  while((cin >> x) && x != 1) {
    solve(x);
  }
}