#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;++i)
#define MAX 300001
bool prime[MAX];

void hurui(){
  REP(i,MAX) prime[i] = (i%7==1 || i%7==6) ? true : false;
  for(int i=6; i*i<MAX; ++i){
    if(prime[i]){
      for(int j=i*i; j<MAX; j+=i) prime[j] = false;
    }
  }
}
int main(){
  hurui();
  int n;
  while(cin>>n, n!=1){
    cout<<n<<":";
    for(int i=2; i<=n; ++i){
      if(prime[i] && n%i==0) cout<<" "<<i;
    }
    cout<<endl;
  }
  return 0;
}