Problem:
Score : 300 points

Problem Statement

1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:

the dogs numbered 1,2,\cdots,26 were respectively given the names a, b, ..., z;

the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;

the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;

the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;

the dogs numbered 475255,475256,\cdots were respectively given the names aaaaa, aaaab, ...;

and so on.

To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names:

a, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...

Now, Roger asks you:

"What is the name for the dog numbered N?"

Constraints

N is an integer.

1 \leq N \leq 1000000000000001

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer to Roger's question as a string consisting of lowercase English letters.

Sample Input 1

2

Sample Output 1

b

Sample Input 2

27

Sample Output 2

aa

Sample Input 3

123456789

Sample Output 3

jjddja

Solution in C++ (GCC 9.2.1) (judge verdict: Wrong Answer)


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
#include<string.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p; 
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int main(){
   ll N,x,y,z,l=1;
   cin>>N;
    y=N%26;
   while(N>0){
       x=N;
       z=N%26;
       if(x>26){
           x=N/26;
           }
        else x=y;
       if(x==0) cout<<'z';
       if(x==1) cout<<'a';
       if(x==2) cout<<'b';
       if(x==3) cout<<'c';
       if(x==4) cout<<'d';
       if(x==5) cout<<'e';
       if(x==6) cout<<'f';
        if(x==7) cout<<'g';
       if(x==8) cout<<'h';
       if(x==9) cout<<'i';
       if(x==10) cout<<'j';
       if(x==11) cout<<'k';
       if(x==12) cout<<'l';
       if(x==13) cout<<'m';
        if(x==14) cout<<'n';
       if(x==15) cout<<'o';
       if(x==16) cout<<'p';
       if(x==17) cout<<'q';
       if(x==18) cout<<'r';
       if(x==19) cout<<'s';
       if(x==20) cout<<'t';
       if(x==21) cout<<'u';
       if(x==22) cout<<'v';
       if(x==23) cout<<'w';
       if(x==24) cout<<'x';
       if(x==25) cout<<'y';
       N/=26;
   }
}