#include using namespace std; template using pv=vector>; template using matrix=vector>; template using pque=priority_queue; template using lpque=priority_queue,greater>; using ll=long long; using intpair=pair; using llpair=pair; using ilpair=pair; using lipair=pair; using intvec=vector; using llvec=vector; using intq=queue; using llq=queue; using intmat=vector; using llmat=vector; #define PI 3.141592653589793 #define INTINF ((1<<30)-1) #define LLINF ((1LL<<62)-1) #define MPRIME 1000000007 #define MPRIME9 998244353 #define MMPRIME ((1ll<<61)-1) #define len length() #define pushb push_back #define fi first #define se second #define all(name) name.begin(),name.end() #define rall(name) name.rbegin(),name.rend() #define gsort(vbeg,vend) sort(vbeg,vend,greater<>()) template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline void init(T& v) { for(auto &a: v) cin>>a; } template inline void init(vector>& v) { for(auto &a: v) cin>>a.first>>a.second; } template inline void init(T& v, N n) { v.resize(n); for(auto &a: v) cin>>a; } template inline void init(vector>& v, N n) { v.resize(n); for(auto &a: v) cin>>a.first>>a.second; } template inline void out(T a) { cout< inline void out(T a, U... alist) { cout<(alist)...); } template void resiz(N n) { //empty } template void resiz(N n, T&& hd, U&&... tl) { hd.resize(n); resiz(n,forward(tl)...); } ll binpow(ll a, ll ex, ll p) { ll result=1; while(ex>0) { if(ex&1) result=result*a%p; ex>>=1; a=a*a%p; } return result; } ll A; ll ans=LLINF; void input() { cin>>A; } void solve() { for(int N=2; N<=7; N++) { ll mul=1, M=0; while(A > mul) { mul*=N; M++; } chmin(ans,N*M); } cout<