#include<iostream>
#include<string>
using namespace std;
int a[301], c[301], tmp[301];
long long b;
string s1, s2;
void strtoint(string s, int des[])
{
for (int i = 0; i < s.size(); i++) {
des[i+1] = s[i] - '0';
}
}
void printArray(int arr[], int len)
{
for (int i = 1; i <= len; i++) {
cout << arr[i];
}
}
void printArray_reverse(int arr[], int len)
{
for (int i = len; i >= 1; i--) {
cout << arr[i];
}
}
int main()
{
cin >> s1;
strtoint(s1, a);
int la = s1.size();
int num = 0;
for (int k = 2; k <= 9; k++) {
int tmp = 0;
//低精度除法
for (int i = 1; i <= la; i++) {
c[i] = (tmp * 10 + a[i]) / k; //商
tmp = (tmp * 10 + a[i]) % k; //余数
}
if (tmp == 0) {
cout << k << " ";
num++;
}
}
if (num == 0) {
cout << "none";
}
return 0;
system("pause");
}