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# (.NET Core 3.1.201) (judge verdict: Wrong Answer)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC171C
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long keta = 0;
            //while (jou <= N)
            //{
            //    keta += 1;
            //    jou *= 26;
            //}
            if (1 <= N & N <= 26)
            {
                keta = 0;
            }
            else if (27 <= N & N <= 702)
            {
                keta = 1;
            }
            else if (703 <= N & N <= 18278)
            {
                keta = 2;
            }
            else if (18279 <= N & N <= 475254)
            {
                keta = 3;
            }
            else if (475255 <= N & N <= 12356630)
            {
                keta = 4;
            }
            else if (12356631 <= N & N <= 321272406)
            {
                keta = 5;
            }
            else if (321272407 <= N & N <= 8353082582)
            {
                keta = 6;
            }
            else if (8353082583 <= N & N <= 217180147158)
            {
                keta = 7;
            }
            else if (217180147159 <= N & N <= 5646683826134)
            {
                keta = 8;
            }
            else if (5646683826135 <= N & N <= 146813779479510)
            {
                keta = 9;
            }
            else if(146813779479511<=N)
            {
                keta = 10;
            }
            //Console.WriteLine(keta);
            var ans = new List<string>();
            if (keta > 0)
            {
                for (long i = keta; i > 0; i--)
                {
                    long a = 1;
                    for (int j = 0; j < i; j++)
                    {
                        a *= 26;
                    }
                    //Console.WriteLine(a);
                    long count = 0;
                    while (N > a&count<26)
                    {
                        N -= a;
                        count += 1;
                    }
                    //Console.WriteLine(count);
                    switch (count)
                    {
                        case 1:
                            ans.Add("a");
                            break;
                        case 2:
                            ans.Add("b");
                            break;
                        case 3:
                            ans.Add("c");
                            break;
                        case 4:
                            ans.Add("d");
                            break;
                        case 5:
                            ans.Add("e");
                            break;
                        case 6:
                            ans.Add("f");
                            break;
                        case 7:
                            ans.Add("g");
                            break;
                        case 8:
                            ans.Add("h");
                            break;
                        case 9:
                            ans.Add("i");
                            break;
                        case 10:
                            ans.Add("j");
                            break;
                        case 11:
                            ans.Add("k");
                            break;
                        case 12:
                            ans.Add("l");
                            break;
                        case 13:
                            ans.Add("m");
                            break;
                        case 14:
                            ans.Add("n");
                            break;
                        case 15:
                            ans.Add("o");
                            break;
                        case 16:
                            ans.Add("p");
                            break;
                        case 17:
                            ans.Add("q");
                            break;
                        case 18:
                            ans.Add("r");
                            break;
                        case 19:
                            ans.Add("s");
                            break;
                        case 20:
                            ans.Add("t");
                            break;
                        case 21:
                            ans.Add("u");
                            break;
                        case 22:
                            ans.Add("v");
                            break;
                        case 23:
                            ans.Add("w");
                            break;
                        case 24:
                            ans.Add("x");
                            break;
                        case 25:
                            ans.Add("y");
                            break;
                        case 26:
                            ans.Add("z");
                            break;
                    }

                }
            }
            switch (N)
            {
                case 1:
                    ans.Add("a");
                    break;
                case 2:
                    ans.Add("b");
                    break;
                case 3:
                    ans.Add("c");
                    break;
                case 4:
                    ans.Add("d");
                    break;
                case 5:
                    ans.Add("e");
                    break;
                case 6:
                    ans.Add("f");
                    break;
                case 7:
                    ans.Add("g");
                    break;
                case 8:
                    ans.Add("h");
                    break;
                case 9:
                    ans.Add("i");
                    break;
                case 10:
                    ans.Add("j");
                    break;
                case 11:
                    ans.Add("k");
                    break;
                case 12:
                    ans.Add("l");
                    break;
                case 13:
                    ans.Add("m");
                    break;
                case 14:
                    ans.Add("n");
                    break;
                case 15:
                    ans.Add("o");
                    break;
                case 16:
                    ans.Add("p");
                    break;
                case 17:
                    ans.Add("q");
                    break;
                case 18:
                    ans.Add("r");
                    break;
                case 19:
                    ans.Add("s");
                    break;
                case 20:
                    ans.Add("t");
                    break;
                case 21:
                    ans.Add("u");
                    break;
                case 22:
                    ans.Add("v");
                    break;
                case 23:
                    ans.Add("w");
                    break;
                case 24:
                    ans.Add("x");
                    break;
                case 25:
                    ans.Add("y");
                    break;
                case 26:
                    ans.Add("z");
                    break;
            }
            int L = ans.Count();
            //Console.WriteLine(L);
            string[] answer = new string[L];
            for(int i = 0; i < L; i++)
            {
                answer[i] = ans[i];
            }
            Console.WriteLine(string.Join("", answer));
        }
    }
}