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


int main() {
  int n;
  vector<bool> prime(300100, false);
  for (int i = 1; i < prime.size(); i++) if (i % 7 == 1 || i % 7 == 6) prime[i] = true;
  vector<int> nlist;
  prime[1] = false;
  for (int i = 1; i < prime.size(); i++) {
    if (prime[i]) {
      nlist.push_back(i);
      for (int j = 2 *i; j < prime.size(); j += i) {
	prime[j] = false;
      }
    }
  }
  while (cin >> n, n != 1) {
    cout << n << ':';
    for (int i = 0; i < nlist.size(); i++) {
      if (n % nlist[i] == 0) cout << ' ' << nlist[i];
    }
    cout << endl;
  }
  

  return 0;
}