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 Kotlin (1.3.71) (judge verdict: Accepted)

fun main(args: Array<String>) {

    var tmpLine = readLine()

    
    val result = experiment(tmpLine!!)

    println(result)
}

fun experiment(input: String) : String {

    val n = input.toLong()-1
    var result = ""
    val atozList = mutableListOf<String>()
    for (alphabet in 'a'..'z') {
        atozList.add("${alphabet}")
    }



    val amari1 = n % 26 // 0-25 0 の場合は+26 -1 + 2
    val sho1 = (n - amari1) / 26
    // val idx1 = if (amari1 == 0L) 26 else amari1.toInt()
    val idx1 = amari1.toInt()
    result = atozList[idx1] + result
    if (sho1 < 1L) return result

    var nextVal = sho1

    while (nextVal > 0) {
        nextVal = nextVal -1
        val amari2 = nextVal % 26
        // val idx2 = if (amari2 == 0L) 26 else amari2.toInt()
        val idx2 = amari2.toInt()
        val sho2 = (nextVal - amari2) / 26
        result = atozList[idx2] + result
        if (sho2 < 1L) return result
        nextVal = sho2
    } 

    // var nextVal2 = sho1
    // val amari2 = nextVal2 % 26
    // val sho2 = (nextVal2 - amari2) / 26
    // result = atozList[amari2-1] + result
    // if (sho2 == 0) return result

    // var nextVal3 = sho2
    // val amari3 = nextVal3 % 26
    // val sho3 = (nextVal3 - amari3) / 26
    // result = atozList[amari3-1] + result
    // if (sho3 == 0) return result

    // var nextVal4 = sho3
    // val amari4 = nextVal4 % 26
    // val sho4 = (nextVal4 - amari4) / 26
    // result = atozList[amari4-1] + result
    // if (sho4 == 0) return result

    // var nextVal5 = sho4
    // val amari5 = nextVal5 % 26
    // val sho5 = (nextVal5 - amari5) / 26
    // result = atozList[amari5-1] + result
    // if (sho5 == 0) return result

    // var nextVal6 = sho5
    // val amari6 = nextVal6 % 26
    // val sho6 = (nextVal6 - amari6) / 26
    // result = atozList[amari6-1] + result
    // if (sho6 == 0) return result

    return result
}