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 (Python):
N = int(input())
alp = [chr(i) for i in range(ord('a'), ord('z')+1)]
ans = []

while N > 0:
    res = N % 26
    ans.append(alp[res - 1])
    N //= 26
    if res == 0:
        N -= 1

ans = ans[::-1]
print(''.join(ans))

Solution (Python):
n = int(input())
ans = ""

for i in range(1,99):
    if n <= 26 ** i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a') + n % 26)
            n //= 26
        break
    else:
        n -= 26 ** i

print(ans[::-1])

Solution (Python):
n = int(input())
ans = ''
while n > 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26
print(ans[::-1])

Solution (Python):
N=int(input())
P=''
while True :
    P=chr(ord('a')+(N-1)%26)+P
    N=(N-1)//26
    if N <= 0 :
        break
print(P)

Solution (Python):
n=int(input())
n-=1
i=26
c=1
while n-i>=0:
    n-=i
    i*=26
    c+=1
al=list('abcdefghijklmnopqrstuvwxyz')
ans=[]
for i in range(c):
    ans.append(al[n%26])
    n=n//26
ans.reverse()
print(''.join(ans))

Solution (Python):
N=int(input())
a=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

name=[]

for i in range (20):
    N=N-1
    name.insert(0,a[N%26])
    N=N//26
    if N==0:
        break

print(''.join(name))

Solution (Python):
from collections import deque

N = int(input())
mod = 26
count = 1

for i in range(11):
    if N > mod ** (i+1):
        N -= mod ** (i+1)
        count += 1
    else:
        break

tmp = N-1
num = deque([0 for i in range(count)])

for i in reversed(range(len(num))):
    num[i] = chr(ord('a') + tmp % mod)
    tmp = tmp // mod

print(''.join(num))

Solution (Python):

def main():
    n = int(input())
    ans = ''
    
    for i in range(1, 99):
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans += chr(ord('a') + n % 26)
                n //= 26
            break
        else:
            n -= 26 ** i
    
    print(ans[::-1])
    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = ''
while n>0:
    n -= 1
    ans += chr(ord('a') + n%26)
    n //= 26
print(ans[::-1])

Solution (Python):
n = int(input())
ans = ''
for i in range(1, 99):
    if n <= 26 ** i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a') + n%26)
            n //= 26
        break
    else:
        n -= 26 ** i
print(ans[::-1])

Solution (Python):
def f(N):
    if N == 0: return ""
    N -= 1
    return f(N//26) + chr(97 + N%26)

N = int(input())
print(f(N))

Solution (Python):
N = int(input())
set_index = ''
while N > 0:
    N -= 1
    index = (N % 26) + ord('a')
    set_index += chr(index)
    N //= 26
print(set_index[::-1])

Solution (Python):
n=int(input())
ans=""
while n>0:
  n-=1
  ans+=chr(ord("a")+n%26)
  n//=26
print(ans[::-1])

Solution (Python):

N = int(input())
AL = []
while N >0:
    N -= 1
    amari = N % 26 
    AL.append(amari)
    N = int(N // 26)

S = [chr(ord('a')+al) for al in AL]

print(''.join(S[::-1]))

Solution (Python):


N = int(input())

ans = ''
while N > 0:
    N -= 1
    t = N % 26
    ans = chr(t+97) + ans
    N //= 26

print(ans)

Solution (Python):
num = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

while num > 0:
    num -= 1
    num, rest = divmod(num, 26)
    ans += s[rest]
    
        
print(ans[::-1])

Solution (Python):
n = int(input())
number = ""

while n != 0:
    a = n % 26
    if a == 0:
        number += (chr(a + 26 + 96))
        n = n // 26 - 1
    else:
        number += (chr(a + 96))
        n = n // 26
number = number[::-1]
print(number)

Solution (Python):
N = int(input())
lst = []
while N > 0:
    a = N % 26
    if a == 0:
        a = 26
        N -= 26
    lst.append(chr(96 + a))
    N //= 26

print("".join(lst)[::-1])

Solution (Python):
n = int(input())
ans = ""
while n > 0:
  n -= 1
  ans = chr(ord('a') + n%26) + ans
  n //= 26
print(ans)

Solution (Python):
n = int(input())
ans = ''
while n != 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26
print(ans[::-1])

Solution (Python):
n = int(input())
number = ""

while n != 0:
    n = n - 1
    number += (chr(n % 26 + 97))
    n = n // 26
number = number[::-1]
print(number)

Solution (Python):
N = int(input())
ans = ""
while N > 0:
    N -= 1
    ans += chr(ord("a") + N % 26)
    N //= 26
print(ans[::-1])

Solution (Python):
n = int(input())
ans = ""
while n:
    n -= 1
    ans += chr(n%26+ord("a"))
    n //= 26

print(ans[::-1])

Solution (Python):
n=int(input())
ans=''
check='abcdefghijklmnopqrstuvwxyz' 
while n!=0:
 n-=1
 ans+=check[n%26] 
 n//=26
print(ans[::-1])

Solution (Python):
N = int(input())
ans = ''
while N > 0:
  N -= 1
  ans += chr(ord('a') + N % 26)
  N //= 26
print(ans[::-1])

Solution (Python):
N = int(input())
lst = []
while N > 26:
    N -= 1
    lst.insert(0,chr(N % 26 + 97))
    N //= 26
lst.insert(0,chr(N+96))
print(*lst,sep="")

Solution (Python):
n=int(input())




res=''


while n>0:
    n-=1
    res+=chr(ord("a")+n%26)
    n//=26
print(res[::-1])

Solution (Python):

"""
Created on Sun Jun 21 21:09:05 2020

@author: naoki
"""

def base(n,b):
    p = n
    digits = "abcdefghijklmnopqrstuvwxyz"
    s=[]
    while p >=1:
        if p >=27:
            if p%b == 0:
                s.append(digits[25])
                p = p // b - 1  
            else:    
                s.append(digits[p%b-1])
                p = p // b
        else:
            s.append(digits[p - 1])
            p = 0
    return "".join(reversed(s))
N = int(input())
print(base(N,26))

Solution (Python):
N = int(input())
alpha =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
x = 1
Z = 'A'
while N > 0:
    if N % 26 == 0:
        Z += 'z'
        N = (N - 1)  //26
    else:
        Z += alpha[((N - 1)  % 26)]
        N = N // 26



for i in range(len(Z) - 1, 0 , -1):
    print(Z[i], end = '')

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)
from string import ascii_lowercase
t=ascii_lowercase
ans=""
n=int(input().rstrip())
while n>0:
    n-=1
    ans+=t[n%26]
    n//=26
print(ans[::-1])

Solution (Python):
import math

n=int(input())

prev=0
val=26
count=1
while prev+val<n:
    prev=val+prev
    val*=26
    count+=1
   
n=n-prev-1

init=ord('a')
ans=""
while count:
    q,r=divmod(n,26)
    n=q
    ans+=chr(init+r)
    count-=1

print(ans[::-1])

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
S = []
for i in range(1,100):
    if N < 27:
        break
    N -= 1
    S.append(chr(ord('a')+N%26))
    N = N//26
S.append(chr(ord('a')+N-1))
print(''.join(S[::-1]))

Solution (Python):
N = int(input())
N -= 1
S = chr(N % 26 + 97)
N //= 26
while N > 0:
  N -= 1
  S += chr(N % 26 + 97)
  N //= 26
print(S[::-1])

Solution (Python):
N = int(input())
ans=''
for i in range(1,99):
    if N<=26**i:
        N-=1
        for j in range(i):
            ans += chr(ord('a')+N%26)
            N//=26
        break
    else:
        N -= 26**i
print(ans[::-1])

Solution (Python):
n = int(input())

alphabets = [chr(i) for i in range(ord('a'), ord('a') + 26)]

ans = ''
while n > 0:
    n -= 1
    ans = alphabets[n % 26] + ans
    n = n // 26

print(ans)

Solution (Python):
N = int(input())
N -= 1
s = []
for i  in range(12):
    s.append(chr(ord("a")+N%26))
    N //= 26
    if N==0:
        break
    N -= 1
s.reverse()
print(*s, sep="")

Solution (Python):
N=int(input())

l=[]
while N>0:
    N-=1
    a=N%26
    N=N//26
    moji=chr(ord('a')+a)
    l.append(moji)

ans=''.join(l)

print(ans[::-1])

Solution (Python):
n = int(input())
ans = ''
while n > 0:
    n -= 1;
    ans += chr(ord('a') + n % 26)
    n //= 26
print(ans[::-1])

Solution (Python):
import sys



inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))





def solve():
	n = int(input()); alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	i = 0; s = 0
	while n >= s + 26**(i):
		s += 26**i
		i += 1
	
	s = n-s

	ans = ["a"]*i
	while s > 0:
		ans[i-1] = chr(97+s%26)
		i -= 1
		s //= 26
	print(("").join(ans))
		

if __name__ == "__main__":
	solve()

Solution (Python):
N = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"
ans = ""
while True:
    la = N // 26
    sm = N % 26
    if sm == 0:
        sm = 26
        la -= 1
    ans += chars[sm]
    N = la
    if N < 1:
        break
print(ans[::-1])

Solution (Python):
n = int(input())

pre_num = 0
cur_num = 26
length = 1
while n > cur_num:
  length += 1
  pre_num = cur_num
  cur_num += 26 ** length

n -= pre_num + 1
name = []
a = ord('a')
for _ in range(length):
  c = n % 26
  n //= 26
  name.append(chr(a + c))
print(''.join(name[::-1]))

Solution (Python):
import numpy as np
def resolver(N):
    N -= 1
    digits = "abcdefghijklmnopqrstuvwxyz"
    i = 1
    while True:
        if N < 26**i:
            break
        N -= 26**i
        i += 1
    
    number = []
    for _ in range(i):
        tmp = N % 26 
        number.append(tmp)
        N //= 26

    ans = "".join([digits[i] for i in reversed(number)])
    return ans

def test():
    for i in range(1,100):
        ans = resolver(i)
        print(f"\ri={i:03} {ans}", end="")
    print()

def main():

    

    N = int(input())
    
    ans = resolver(N)

    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):

import sys
import numpy as np

bases = [26 ** i for i in range(15)]
cum_sum = np.cumsum(bases)


def int2alpha(i):
    assert i > 0
    return chr(i + 96)


def to_26_base(num):
    res = []
    for i in reversed(range(14)):
        b = bases[i]
        
        if cum_sum[i] <= num < cum_sum[i + 1]:
            if i == 0:
                q = num // b
            else:
                q = (num - cum_sum[i-1]) // b
            num -= q * b
            res.append(q)
    return "".join(int2alpha(x) for x in res)


def solve(N: int):
    print(to_26_base(N))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N = int(input())
    ans = []
    while N:
        N -= 1
        ans.append(chr(N%26 + 97))
        N //= 26
    print(''.join(map(str,ans[::-1])))
if __name__ == '__main__':
    main()

Solution (Python):


import sys
input = sys.stdin.readline
import string

numbers = string.digits                             
abc = string.ascii_lowercase                        
ABC = string.ascii_uppercase                        
characters = numbers + abc + ABC                    


def base_cvt(value, n=2, output=characters):        
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)   

    if n < 2 or n > len(characters):                
        raise ValueError('Invalid n:', value)

    coef = []
    while tmp >= n:
        idx = tmp % n                               
        coef.append(idx)
        tmp = tmp // n                              
    idx = tmp % n
    coef.append(idx)                                
    res = "".join(map(lambda x: output[x], reversed(coef)))
    return res


  
  
N = int(input())

k = 0
while N - 26 ** k >= 0:
    N -= 26 ** k
    k += 1

res = base_cvt(N, 26, abc)
l = len(res)
print("".join(["a"] * (k - l)) + res)

Solution (Python):


import string

numbers = string.digits                             
abc = string.ascii_lowercase                        
ABC = string.ascii_uppercase                        
characters = numbers + abc + ABC                    


def base_cvt(value, n=2, output=characters):        
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)   

    if n < 2 or n > len(characters):                
        raise ValueError('Invalid n:', value)

    coef = []
    while tmp >= n:
        idx = tmp % n                               
        coef.append(idx)
        tmp = tmp // n                              
    idx = tmp % n
    coef.append(idx)                                
    res = "".join(map(lambda x: output[x], reversed(coef)))
    return res


N = int(input())

k = 0
while N - 26 ** k >= 0:
    N -= 26 ** k
    k += 1

res = base_cvt(N, 26, abc)
l = len(res)
print("".join(["a"] * (k - l)) + res)

Solution (Python):
N = int(input())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

Solution (Python):
from collections import defaultdict
it = lambda: list(map(int, input().strip().split()))
INF = float('inf')


if __name__ == '__main__':
    N = int(input())
    ans = ''
    while N:
        if N % 26 == 0:
            ans = chr(ord('a') + 25) + ans
            N //= 26
            N -= 1
        else:
            ans = chr(ord('a') + N % 26 - 1) + ans
            N //= 26
    print(ans)

Solution (Python):
N = int(input())
Alph = [chr(i) for i in range(97, 97+26)]
keta = 1
allz = 26**keta
ans = ""
bifallz = 0
27

while N > allz:
    keta += 1
    bifallz = allz
    allz += 26**keta
    
N = N - (bifallz + 1)

for k in range(keta):
    ans += Alph[N%26]
    N = N//26

print(ans[::-1])

Solution (Python):
N=int(input())
chars="Xabcdefghijklmnopqrstuvwxyz"
res=""
n_rem=N
while True:
  x=n_rem%26
  if x==0:
    x=26
  res+=chars[x]
  n_rem-=x
  if n_rem==0:
    break
  n_rem//=26
print(res[::-1])

Solution (Python):
n = int(input())

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n) - 1, n) + chr(97 + X % n)
    return chr(97 + X % n)

print(Base_10_to_n(n - 1, 26))

Solution (Python):
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  

n_rem = n  
res = ""

while True:
    x = n_rem % 26
    
    if x == 0:
        x = 26
    res += chars[x]

    
    n_rem -= x

    
    if n_rem == 0:
        break

    n_rem //= 26


print(res[::-1])

Solution (Python):
N = int(input())
A = [
    'a',
    'b',
    'c',
    'd',
    'e',
    'f',
    'g',
    'h',
    'i',
    'j',
    'k',
    'l',
    'm',
    'n',
    'o',
    'p',
    'q',
    'r',
    's',
    't',
    'u',
    'v',
    'w',
    'x',
    'y',
    'z',
]
res = []
while N > 0:
    a = (N - 1) % 26
    N = (N - 1) // 26
    res.append(A[a])
res.reverse()
print(''.join(res))

Solution (Python):
digit=list('abcdefghijklmnopqrstuvwxyz')
N=int(input())
ans=[]

for i in range(10):
    if N % 26 ==0:
        d=26
    else:
        d=N%26

    N = N-d
    N = N//26
    ans.append(d)

    if N<=26:
        ans.append(N)
        break

ans=ans[::-1]
ans2=''

for i in ans:
    if i !=0:
        ans2 += digit[i-1]

print(ans2)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    ans = ''
    for i in range(1, 20):
        if n <= 26**i:
            n -= 1
            for j in range(i):
                ans += chr((n % 26) + ord('a'))
                n //= 26
            print(ans[::-1])
            return
        else:
            n -= 26**i

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
alp=[]

mozi=[chr(i) for i in range(97, 97+26)]


while(True):
  K=-1
  K = int(N%26)
  alp.insert(0,mozi[K-1]) 
  if(N<=26):break
  if(K==0):N =(N-26)/26
  else:N = (N-K)/26
    
print(''.join(alp))

Solution (Python):
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case 



def solve(n):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    reversed_result = ""
    while n > 0:
        curr = n % 26
        curr = 25 if curr == 0 else curr - 1
        reversed_result += alphabet[curr]
        n -= curr
        n //= 26
    return reversed_result[::-1]



if __name__ == "__main__":
    n = int_in()
    out(solve(n))

Solution (Python):
n = int(input())
num = 26
alphabet =  [chr(ord('a') + i) for i in range(26)]
ans = []
while n > 0:
    n -= 1
    ans += alphabet[n % num]
    n = n // num
    
ans.reverse()
print("".join(ans))

Solution (Python):
n=int(input())
ans=[]
while n>0:
    n-=1
    a=n%26
    ans.append(chr(ord('a')+a))
    n=n//26
ans.reverse()
print(''.join(ans))

Solution (Python):
import string
alpha = string.ascii_lowercase

n = int(input())

ans = []
while (n):
    res = (n % 26)
    
    
    
    ans.append(alpha[res-1])
    if (n <= 26):
        break
    if n % 26:
        n = n // 26
    else:
        n = n // 26
        n = n - 1



ans = ans[::-1]
print("".join(ans))

Solution (Python):



def main():
    N = int(input())
    al = 'abcdefghijklmnopqrstuvwxyz'
    ret = ''
    while N>0:
        N -=1
        ret += al[N%26]
        N//=26
    print(ret[::-1])

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
result =[]
alphabet = "zabcdefghijklmnopqrstuvwxy"
while(N>0):
    t = N%26
    result.append(alphabet[t])
    N = N//26
    if t == 0:
        N -= 1
result.reverse()

print(''.join(result))

Solution (Python):
N = int(input())
N -= 1

for l in range(1, 100):
    if N >= 26**l:
        N -= 26**l
    else:
        ans = ""
        for i in range(l):
            ans += chr(ord('a') + N % 26)
            N //= 26
        print(ans[::-1])
        break

Solution (Python):
alpha = {1:'a', 2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h', 9:'i', 10:'j', 11:'k', 12:'l', 13:'m', 14:'n', 15:'o', 16:'p', 17:'q', 18:'r', 19:'s', 20:'t', 21:'u', 22:'v', 23:'w', 24:'x', 25:'y', 0:'z'}
n = int(input())
t = ''
while n > 0:
  k = n % 26
  t = alpha[k] + t
  n //= 26
  if k == 0:
    n -= 1
print(t)

Solution (Python):
N = int(input())
ans = ''
alphabet = 'zabcdefghijklmnopqrstuvwxy'
while N > 0:
  ans +=alphabet[N%26]
  N = (N-1)//26
print(ans[::-1])

Solution (Python):
def main():
    n = int(input())
    ans = []
    while n > 0:
        n -= 1
        ans.append(chr(n%26 + ord('a')))
        n //= 26
    print(''.join(ans[::-1]))

if __name__=='__main__':
    main()

Solution (Python):
n=int(input()) 
A=[chr(u) for u in range(97,123)]
na=""
while n>0:
  q=n%26
  na+=A[q-1]
  n= n//26 if n%26!=0 else n//26-1
  
print(na[::-1])

Solution (Python):
n=int(input())
l=[]
s=""
while n>0:
    n=n-1
    a=n%26
    s=chr(a+97)+s
    n=n//26
print(s)

Solution (Python):
import math
N=int(input())
a=int(math.log(N,26))

def saiki(nokori):
    if(nokori<26):

        return aru_list[nokori]
    else:
        return saiki(nokori//26)+aru_list[nokori%26]

koremade=0
nokori=N
count=0

while(1):
    if(nokori-26**(count+1)==0):

        break
    elif(nokori-26**(count+1)<0):
        break
    else:
        nokori=nokori-26**(count+1)

    count=count+1
count=count+1


nokori=nokori-1

aru_list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
b=''
ans=saiki(nokori)


while(1):
    if(len(ans)==count):
        print(ans)
        exit()
    else:
        ans='a'+ans

Solution (Python):
n=int(input())
l=[]
s=""
while n>0:
    n=n-1
    a=n%26
    s=chr(a+97)+s
    n=n//26
print(s)

Solution (Python):
n = int(input())
numbers = []
strings = []
order = 0
while True:
  if n //  26**order > 0:
    order = order + 1
  else:
    break
for i in range(order,0,-1):
  number = n //(26**(i-1))
  n = n - number*26**(i-1)
  numbers.append(number)
  
for i in range(order,1,-1):
  if numbers[i-1] <= 0:
    numbers[i-1] = numbers[i-1] + 26
    numbers[i-2] = numbers[i-2] - 1
 
for i in range(0,order):
  if numbers[i] == 0:
    pass
  else:
    strings.append(chr(ord("a")+int(numbers[i]-1)))
 
print(''.join(strings))

Solution (Python):
A = int(input())
ans = ''
for i in range(1, 99):
	if A <= 26 ** i:
		A -= 1
		for j in range(i):
			ans += chr(ord('a') + A % 26)
			A //= 26
		break
	else:
		A -= 26 ** i
print(ans[::-1])

Solution (Python):
n = int(input())
name = ''

while n>0:
    n -= 1
    name += chr( ord('a')+n%26 )
    n //= 26

print(name[::-1])

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())


ord_a = ord("a")
def C(i):
    return chr(ord_a + i)

def conv(x):
    ans = []
    while x > 0:
        x -= 1
        y = (x)%26
        c = C(y)
        ans.append(c)
        x = x//26
    return "".join(reversed(ans))

print(conv(n))

Solution (Python):
N = int(raw_input())
N -= 1
alphabet = 'abcdefghijklmnopqrstuvwxyz'

p = 26
while N >= p:
  N -= p
  p *= 26
  
p /= 26
answer = ''
while p >= 1:
  answer += alphabet[N/p]
  
  N %= p
  p /= 26
  

print answer

Solution (Python):
x = int(input())
x -= 1
temp = 1



while True:
    mod = x % 26
    div = x // 26

    add = chr(97 + mod)

    if (temp == 1):
        ans = add
    else:
        ans = add + ans

    if (div == 0):
        print(ans)
        exit()

    x /= 26
    x = int(x-1)
    temp += 1

Solution (Python):
def main():
    n = int(input())
    nl = 0
    yokei = 0
    yokei_pre = 0
    while yokei < n:
        nl += 1
        yokei_pre = yokei
        yokei += 26 ** nl

    n -= yokei_pre
    n -= 1
    c = [0] * nl
    for i1 in range(1, nl + 1):
        r = n % 26
        c[-i1] = r
        n = n // 26
    cs = []
    for ce in c:
        ce += 97
        cec = chr(ce)
        cs.append(cec)
    print("".join(cs))


if __name__ == '__main__':
    main()

Solution (Python):
def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())
mod = 10**9 + 7
dog = 10 ** 15 + 1

def main():
  n = int(input())
  ans = ''
  while n > 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26
  print(ans[::-1])

if __name__ == '__main__':
  main()

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

def main(N):
  A = [1]
  for _ in range(100):
    A.append(A[-1] * 26)
  for n in range(1, 100):
    if N > A[n]:
      N -= A[n]
      continue

    N -= 1
    ret = []
    
    for _ in range(n):
      N, r = divmod(N, 26)
      ret.append(r)
    break
  ret = [chr(ord('a') + x) for x in ret]
  return ''.join(reversed(ret))
 
print(main(N))

Solution (Python):
n = int(input())

ans = ""
while n>0:
    n -= 1
    ans += chr(ord("a") + n % 26)
    n //= 26

print(ans[::-1])

Solution (Python):
n=int(input())
ans=""
while n:
	n-=1
	ans+=chr(n%26+ord("a"))
	n//=26
print(ans[::-1])

Solution (Python):
N = int(input())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

Solution (Python):
import string

N = int(input())
ans = []
S =""

while N != 0:
    N -= 1
    a = N % 26
    b = N // 26
    N = b
    ans.append(a)
ans = reversed(ans)

for s in ans:
    S += string.ascii_lowercase[int(s)]

print(S)

Solution (Python):

import sys


def solve(N: int):
    x = 1
    y = ""
    z = N
    while(z > 26):
        z -= 26 ** x
        if z > 0 :
            x += 1
    for i in range(x):
        N -= 1
        y += chr(ord('a') + N % 26)
        N //= 26
    print(y[::-1])
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
keta = 1
su = 0
while True:
    su += 26**keta
    if su >= n:
        break
    keta += 1
n -= su - pow(26,keta) + 1

res = []
for i in range(keta):
    now = keta-i-1
    d,m = divmod(n,pow(26,now))
    res.append(chr(ord('a') + d))
    n = m
print(''.join(res))

Solution (Python):
N = int(input())
for d in range(64):
  if N < (26**(d+1)-1)//(26-1):
    N = N-(26**d-1)//(26-1)
    break

L = []
for i in range(d):
  n = N%26
  c = "abcdefghijklmnopqrstuvwxyz"[n]
  L.append(c)
  N = N//26
r = "".join(reversed(L))
print(r)

Solution (Python):
a=int(input())
K = 0
b = 0
List = [27]*13
res = ""
for i in range(12):
  K = a % 26
  if K ==0:
    K=26
  List[i] = int(K)
  b = a-K
  if b >=26:
    a = b/26
  else:
    break
for i in range(13):
  if List[12-i] ==27:
    pass
  else:
    res += chr(List[12-i]+96)
print(res)

Solution (Python):
N=int(input())


Ans=''
while N>0:
    N-=1
    Ans+=chr(ord('a')+N%26)
    N//=26
print(Ans[::-1])

Solution (Python):
N = int(input())

string = ""
while N > 0:
    N -= 1
    m = N%26
    N = N // 26
    string += chr(97 + m)


print(string[::-1])

Solution (Python):
N = int(input())

ans = ""
while N > 0:
    N -= 1
    ans += chr(ord("a") + N%26)
    N //= 26

print(ans[::-1])

Solution (Python):
n = int(input())
ans = ''
while n > 0:
    n -= 1
    ans += chr(ord('a')+n%26)
    n//=26
print(ans[::-1])

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N = int(readline())
    
    ans = ''
    while N:
        N -= 1
        ans += chr((N % 26) + 97)
        N //= 26

    print(ans[::-1])

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
ans = ""
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord("a") + N % 26)
            N = N // 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Solution (Python):
N = int(input())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

Solution (Python):
n = int(input())

moji = [chr(i) for i in range(97, 97+26)]
ans = ''
while n > 0:
    n -= 1
    x = int(n % 26)
    ans = moji[n % 26] + ans
    n //= 26
print(ans)