#include<iostream>
using namespace std;

int MS[300000];
int judge(int n)
{
  for(int i=0;MS[i]<=n/2;i++){
    if(n%MS[i]==0)return 0;
  }
  return 1;
}
int main()
{
  int n,b=0,a=0,sum;
  for(int i=7;i<300001;i+=7){
    MS[b++]=i-1;
    MS[b++]=i+1;
  }
  while(1){
    cin>>n;
    if(n==1)break;
    cout<<n<<":";
    for(int i=0;i<b;i++){
      if(n%MS[i]==0 && judge(MS[i]) )cout<<" "<<MS[i];
    }
    cout<<endl;
    }
  return 0;
}