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 <stdio.h>
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define rep(i,n) for(ll i=0;i<n;i++)
typedef long long ll;
using namespace std;

const ll MAX = 1000000;
const ll MOD = 1000000007;

ll fac[MAX];

// テーブルを作る前処理
/*
void COMinit() {
    fac[0] = fac[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
    }
}
*/

ll pow_kai(ll a,ll n){//aのn乗を計算します。
  ll x = 1;
  while(n > 0){//全てのbitが捨てられるまで。
    if(n&1){//1番右のbitが1のとき。
      x = x*a%MOD;
    }
    a = a*a%MOD;
    n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
  }
  return x;
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    ll tmp=1;
    for(ll i=n;i>=n-k+1;i--) tmp = (tmp*i)%MOD;

    return (tmp * pow_kai(fac[k],MOD-2)) % MOD;
}

void chmax(ll &a,const ll &b){
    if(a<b) a=b;
}
void chmin(ll &a,const ll &b){
    if(a>b) a=b;
}


int main()
{

    ll N;
    cin >>N;

    ll a,b;

    vector<ll> ans;

    while(N>0){
        ans.push_back(N%26);
        N=N/26;
    }

    for(ll i=ans.size()-1;i>=0;i--){
        if(ans[i]==1){
            cout << 'a';
        }else if(ans[i]==2){
            cout << 'b';
        }else if(ans[i]==3){
            cout << 'c';
        }else if(ans[i]==4){
            cout << 'd';
        }else if(ans[i]==5){
            cout << 'e';
        }else if(ans[i]==6){
            cout << 'f';
        }else if(ans[i]==7){
            cout << 'g';
        }else if(ans[i]==8){
            cout << 'h';
        }else if(ans[i]==9){
            cout << 'i';
        }else if(ans[i]==10){
            cout << 'j';
        }else if(ans[i]==11){
            cout << 'k';
        }else if(ans[i]==12){
            cout << 'l';
        }else if(ans[i]==13){
            cout << 'm';
        }else if(ans[i]==14){
            cout << 'n';
        }else if(ans[i]==15){
            cout << 'o';
        }else if(ans[i]==16){
            cout << 'p';
        }else if(ans[i]==17){
            cout << 'q';
        }else if(ans[i]==18){
            cout << 'r';
        }else if(ans[i]==19){
            cout << 's';
        }else if(ans[i]==20){
            cout << 't';
        }else if(ans[i]==21){
            cout << 'u';
        }else if(ans[i]==22){
            cout << 'v';
        }else if(ans[i]==23){
            cout << 'w';
        }else if(ans[i]==24){
            cout << 'x';
        }else if(ans[i]==25){
            cout << 'y';
        }else{
            cout << 'z';
        }
    }

    cout <<endl;




    return 0;


}