#include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000000 bool is_ok(long long n,long long p){ vector x; while(n!=0){ x.push_back(n%p); n/=p; } rep(i,x.size()-1){ if(x[i]!=x[i+1])return false; } return true; } int main(){ long long N; cin>>N; vector Y; for(long long i=2;i<=1000005;i++){ if(is_ok(N,i)){ cout<