#include //eolibraries #define lnf 3999999999999999999 #define inf 999999999 #define fi first #define se second #define pb push_back #define ll long long #define ld long double #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c).size() #define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()); #define rep(i,n) for(int i=0;i=0;i--) #define crep(i,x,n) for(int i=x;i #define _3sSOzgI ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0) //eodefine using namespace std; using pii=pair; using vi=vec(int); const int mxn=12000; vi rabbits={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61}; const int m=sz(rabbits); ll prod[1048576]; vi cand; void slv(){ int n; cin>>n; auto findmagic=[&](ll g,ll x){ ll l=1,r=x,c=-1; if(g>=60){ return c=1; } while(l<=r){ ll m=(l+r)/2; ll jj=g; ll y=1; bool pok=1; while(jj>0){ if(y>x/m){ pok=0; break; } y*=m; jj=jj-1; } if(pok){ c=m; l=m+1; }else{ r=m-1; } } return c; }; auto f=[&](ll x){ ll sum=0; for(auto msk : cand){ ll g=1; bool caughtone=0; g=prod[msk]; int k=__builtin_popcount(msk); ll up; if(g<60) up=findmagic(g,x); else up=1; if(k%2) sum+=up; else sum-=up; } sum+=2380; // printf("%lld\n",sum); return sum; }; // f(10);2 ll l=0,r=997995681331086344,c=-1; while(l<=r){ ll m=(l+r)/2; if(f(m)>=n){ r=m-1; }else{ c=m; l=m+1; } } printf("%lld\n",c+1); // cout<4){ if(k%2) sum+=1; else sum-=1; }else{ prod[msk]=1; rep(i,m){ if(msk&(1<>t; rep(cs,t){ slv(); } // return 0; }