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())
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']
b = ''
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = a[X_dumy%n-1]+out
        if a[X_dumy%n-1] == 'z':
          X_dumy -= 26
        X_dumy = X_dumy//n
    return out
 
z = Base_10_to_n(n, 26)
print(z)

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


def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)














print(num2alpha(k).lower())

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']






accm = 1

name = ""
for i in range(1, 20):

    start = accm
    end = pow(26, i)
    accm += end

    if n >= start and n <= accm - 1:

        hoge = n - start


        

        remen = hoge

        for k in reversed(range(0, i)):
            temp = remen // pow(26, k)
            remen = remen % pow(26, k)
            

            
            
            name += alpha[temp]
            


print(name)

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

n = 26
nl = [26**i for i in range(1,12)]

for i in range(12):
    if num <= sum(nl[:i]):
        break
maxpower = i
num = num - sum(nl[:i-1])-1

lst = []
for i in range(maxpower-1, 0, -1):
    lst.append(num // (26**i))
    num = num % (26**i)
lst.append(num)

letters = 'abcdefghijklmnopqrstuvwxyz'

result = ''

for i in lst:
    result += letters[i]

print(result)

Solution (Python):
letters = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
n -= 1
bnds = [0]
i = 1
bnd = 1
while bnd <= 1000000000000001:
    bnd = int(26*(1-26**i)/(1-26))
    bnds.append(bnd)
    i += 1
for i in range(len(bnds)-1):
    if bnds[i] <= n < bnds[i+1]:
        j = i
n -= bnds[j]
ans = []
for i in range(j+1):
    x = n // (26**(j-i))
    
    ans.append(letters[x])
    n -= x * (26**(j-i))
print(''.join(ans))

Solution (Python):
import sys

def input():
    return sys.stdin.readline()[:-1]

N = int(input())

alphabet = "zabcdefghijklmnopqrstuvwxy"


name = ""

for i in range(10000):
    if N <= 26:
        q = N // 26
        mod = N % 26
        if mod == 0:
            q -= 1
        name = alphabet[mod] + name
        break
    else:
        q = N // 26
        mod = N % 26
        if mod == 0:
            q -= 1
        name = alphabet[mod] + name
        N = q


    


print(name)

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

def num2alpha(num):
    if num <= 26:
        return chr(64+num)
    elif num % 26 == 0:
        return num2alpha(num // 26 - 1) + chr(90)
    else:
        return num2alpha(num // 26) + chr(64 + num % 26)

print(num2alpha(N).lower())

Solution (Python):
def calc(num):
    if num % 26 != 0:
        res.append(num % 26)
    else:
        res.append(26)
        num -= 26

    if num // 26 > 0:
        calc(num // 26)

def printres():
    for obj in reversed(res):
        print(dic[obj], end="")
    print()

dic = {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", 26:"z"}

res = []


N = int(input())

calc(N)

printres()

Solution (Python):
s=int(input())
a=s
alp=list("abcdefghijklmnopqrstuvwxyz")
ans=""
i=1

while s!=0:
    jo=(26**i)
    x=s%jo
    if x==0:
      x=jo
    s-=x
    x//=26**(i-1)
    
    ans=alp[x-1]+ans
    i+=1


  
print(ans)

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


def Base_10_to_n(X, n):
    
    X_dumy = X
    out = ''
    while X_dumy > 0:
        a = X_dumy % n
        if a == 0:
            a = 26
            X_dumy -= 1
        out = string[a - 1] + out
        X_dumy = int(X_dumy / n)

    return out


string = 'abcdefghijklmnopqrstuvwxyz'
print(Base_10_to_n(N, 26))

Solution (Python):
x = int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
a = num2alpha(x)
print(a.lower())

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


amari = []
while(N>0):
    if N%26 == 0:
        amari.append("z")
        N = N//26-1
    else:
        amari.append(chr(N%26+96))
        N = N//26
amari.reverse()
for i in range(len(amari)):
    print(amari[i],end = "")

Solution (Python):
N=int(input())
dic= ['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']

N -=1
ans = ''
while N >= 26:
    a = N%26
    N = N//26 -1
    ans = dic[a] + ans
    

ans = dic[N] + ans  
print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())
i = 0
while 26 ** i < n:
    i += 1
    if 26**i > n:
        i -= 1
        break
start = ["a"]*i

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
m = num2alpha(n)

ans = []
print(m.lower())

Solution (Python):

def tostr(N):
    if N == 0:
        return "a"
    if N == 1:
        return "b"
    if N == 2:
        return "c"
    if N == 3:
        return "d"
    if N == 4:
        return "e"
    if N == 5:
        return "f"
    if N == 6:
        return "g"
    if N == 7:
        return "h"
    if N == 8:
        return "i"
    if N == 9:
        return "j"
    if N == 10:
        return "k"
    if N == 11:
        return "l"
    if N == 12:
        return "m"
    if N == 13:
        return "n"
    if N == 14:
        return "o"
    if N == 15:
        return "p"
    if N == 16:
        return "q"
    if N == 17:
        return "r"
    if N == 18:
        return "s"
    if N == 19:
        return "t"
    if N == 20:
        return "u"
    if N == 21:
        return "v"
    if N == 22:
        return "w"
    if N == 23:
        return "x"
    if N == 24:
        return "y"
    if N == 25:
        return "z"
    if N == 0:
        return "z"


def main(N):
    N -= 1
    ans = ""
    loop = 0
    while True:
        if N < 0:
            break
        if N <= 25:
            ans = tostr(N)+ans
            break
        ans = tostr(N % 26)+ans
        N = N//26
        N -= 1
    return ans


N = int(input())
print(main(N))

Solution (Python):
n = int(input())
a = 26
keta = 1
nn = 0
while n > 0:
    if n > a:
        keta += 1
        n -= a
        a *= 26
    else:
        nn = n - 1
        n -= a

l = []
for i in range(keta):
    amari = nn % 26
    nn = nn // 26
    l.append(amari)
revl = []
for i in range(len(l)-1,-1,-1):
    revl.append(l[i]+97)
ansl = []
for i in revl:
    ansl.append(chr(i))
print("".join(ansl))

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

s=''

num2alpha = lambda c: chr(c+96)

q=n
while 1:
    q, mod = divmod(q, 26)

    if mod==0:
        s=s+'z'
        q-=1
    else:
        s=s+num2alpha(mod)
    if q<=26:
        if q!=0:
            s=s+num2alpha(q)
        break;

s = s[::-1]
print(s)

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

def num2alpha(num):
    if num <= 26:
        return chr(96 + num)
    elif num % 26 == 0:
        return num2alpha(num // 26 - 1) + chr(122)
    else:
        return num2alpha(num // 26) + chr(96 + num % 26)

print(num2alpha(n))

Solution (Python):
import math
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()-1
    name = [n%26]
    n = n // 26 -1
    while n >= 0:
        name.append(n%26)
        n  = n // 26 -1
    name.reverse()
    for na in name:
        print(chr(ord('z')-25+na), end='')
    print()

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
lis = [chr(ord('a') + i) for i in range(26)]

i=1
while True:
    if n <= 26**i:
        break

    else:
        n -= 26**i
        i += 1

ans = []

for j in range(i-1, -1, -1):
    s1 = n // (26**j)
    s2 = n % (26**j)
    if s2 == 0:
        s1 -= 1
    if j > 0:
        if s1 >= 26:
            s1 = 25
            ans.append(lis[-1])
        else:
            ans.append(lis[s1])
        n -= (26**j) * s1
    elif j == 0:
        ans.append(lis[n-1])

print(''.join(ans))

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]




import string

N = ii()
alpha = [chr(i) for i in range(97, 97+26)]
N_ = N
'''
alpha = [chr(i) for i in range(97, 97+26)]
if 0 <= N <= 25:
    print(alpha[i])
elif 26<= N <= 702:
'''
ans = ''
N -= 1
a = float('inf')
flag = False
'''
while True:
    N, a = N//26, N%26
    
    
    if ans == '' or ans[-1] != 'z' :
        ans += alpha[a-1]
    else:
        ans += alpha[a-2]
        flag = False
    if N == 0:
        break

'''
while True:
    N, a = N//26, N%26
    
    
    
    ans += alpha[a]
    
        
    flag = True
    N -= 1
    if N < 0:
        break
    
        
        
    
        





    
    
        
    


    

print(ans[::-1])

Solution (Python):
def ans(an, n, N, X, x, inx):
  N -= inx * x ** (n + 1)
  if n == 0:
    an += X[N]
    return an
  
  an += X[N // x**n]
  inx = N // x**n
  n -= 1
  return ans(an, n, N, X, x, inx)
N = int(input())
X = "abcdefghijklmnopqrstuvwxyz"
an = ""
x = 26
n = 1
inx = 0
while N > x * ((x**n - 1)//(x - 1)):
  n += 1
n -= 1
N -= x * ((x**n - 1)//(x - 1)) + 1
print(ans(an, n, N, X, x, inx))

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

ans = []
lst = []
n = N

while n > 26:
    x = n%26
    if x == 0:
        n = n//26 - 1
    else:
        n = n//26
    lst.append(x)


for i in range(len(lst)):
    x = lst[i]
    if x == 0:
        y = chr(97+25)
    else:
        y = chr(97 + x-1)
    ans.append(y)

ans.append(chr(97 + n-1))

ans = ans[::-1]

ans = ''.join(ans)
print(ans)

Solution (Python):
n=int(input())
const=list('abcdefghijklmnopqrstuvwxyz')
res = ''
tmp=n
while 1:
  y = tmp % 26
  res = const[y-1]+res
  tmp = tmp // 26 if y else tmp//26-1
  
  if tmp==0:
    break
print(res)

Solution (Python):
from bisect import bisect_left, bisect_right
N = int(input())

MOJI = [26]
for i in range(2,12):
  MOJI.append(MOJI[i-2]+26**i)



C = bisect_left(MOJI, N)+1

ans = []
for i in range(0,C):
  tmp = N%26
  if tmp == 0:
    tmp = 26
  
  ans.append(chr(tmp+ord("a")-1))
  N = (N-tmp)//26
  

ans.reverse()

L=[str(a) for a in ans]
L="".join(L)
print(L)

Solution (Python):

import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))


def main():
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    mod = 26
    n = ni()
    ans = ''
    while n > mod:
        ans += ascii_lowercase[(n%mod)-1]
        if n%mod == 0:
            n = int(n/mod)-1
        else:
            n = int(n/mod)
    ans += ascii_lowercase[(n%mod)-1]
    print(ans[::-1])
    return


if __name__ == '__main__':
    main()

Solution (Python):
al = ["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"]
N = int(input())
ans = ""
i = 0
while N > 0:
    r = N%26
    if r == 0:
        r = 26
    ans = al[r-1] + ans
    N = int((N - r) / 26)
print(ans)

Solution (Python):
n = int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
print(num2alpha(n).lower())

Solution (Python):
N = int(input())
name = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    name = chr(ord('a') + remainder) + name
print(name)

Solution (Python):
n=int(input())
import math
k=math.ceil(math.log(25*n+26,26))-1 
n=n-(26**k -26)//25-1
s=""
al=['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"]
for i in range(k):
  s=al[n%26]+s
  n=n//26
print(s)

Solution (Python):


N = int(input())

dik = {0:"a",
       1:"b",
       2:"c",
       3:"d",
       4:"e",
       5:"f",
       6:"g",
       7:"h",
       8:"i",
       9:"j",
       10:"k",
       11:"l",
       12:"m",
       13:"n",
       14:"o",
       15:"p",
       16:"q",
       17:"r",
       18:"s",
       19:"t",
       20:"u",
       21:"v",
       22:"w",
       23:"x",
       24:"y",
       25:"z"}

x = 0
ans = ""
n = N

while n > 0:
    n = n - 1
    x = n % 26
    ans += dik[x]
    n = n // 26

ans = ans[::-1]

print(ans)

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial

from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

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

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

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

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

n = I()
def base(n, b, digits="abcdefghijklmnopqrstuvwxyz"):
    s = []
    while n>0:
        n -= 1
        s.append( digits[(n%b)] )
        n //= b
    return ''.join(reversed(s))

ans = base(n,26)

print(ans)

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

for k in range(20):
    if (26**k-1)//25<=n<(26**(k+1)-1)//25:
        n-=26*(26**(k-1)-1)//25
        break

ans=''
for i in range(k):
        ans+='abcdefghijklmnopqrstuvwxyz'[((n-1)//26**i)%26]

print(ans[::-1])

Solution (Python):
N = int(input())
x = 1
alphabet = {i-96:chr(i) for i in range(97, 97+26)}
if int(N) > 26:
    ans = ''
    while x != 0:
        x = N // 26
        mod = N%26
        
        if mod == 0:
            ans += 'z'
            
            x -= 1
        else:
        
            ans += alphabet[mod]
        N = x
else:
    ans = alphabet[int(N)]
print(ans[::-1])

Solution (Python):
N = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
A = []
B = []

while N > 26:
    a = N
    N //= 26
    mod = a % 26
    if mod == 0:
        mod = 26
        N -= 1 
    A.append(mod)

A.append(N)
A = A[::-1]

for x in A:
    B.append(alpha[x-1])

ans = ''.join(map(str, B))

print(ans)

Solution (Python):

N=int(input())
alpha="zabcdefghijklmnopqrstuvwxy"
cnt=1
while True:
    if N<=26**cnt:
        break
    N-=26**cnt
    cnt+=1
ans=""
for i in range(cnt):
    ans=alpha[N%26]+ans
    N=(N-1)//26+1
print(ans)

Solution (Python):
N = int(input())
n = N
cnt = 0
while N > 0:
    cnt += 1
    if N > 26:
        N -= 26 ** cnt
    else:
        break

s = 0
for i in range(1,cnt):
    s += 26 ** i
k = n-s-1

A = []
for i in range(cnt):
    A.append(k%26)
    k = k // 26
    
ans = []
for i in A:
    ans.append(chr(i + 97))

print(*ans[::-1], sep = "")

Solution (Python):
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import string

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))


def solve():
    return

def main():
    n = get_int()
    terms = 0
    i = 1
    while n>terms:
        terms += 26**i
        i += 1
    
    i -= 2
    ans = ""
    n  = n-(terms-26**(i+1))-1
    if n==0: ans = "a"*(i+1)
    alphabets = list(string.ascii_lowercase)
    while n>0:
        index,n = divmod(n,26**i)
        i -= 1
        
        ans += alphabets[index]
        if n==0 and i==0: ans += "a"

    print(ans)



TestCases = False

if TestCases:
    for i in range(get_int()):
        main()
else:
    main()

Solution (Python):
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 12)]
lis = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())
for b in reversed(bounds):
    if b <= N:
        break
N -= b 
length = bounds.index(b) + 1
s = ''
for i in range(length - 1, 0, -1):
    idx, N = divmod(N, 26**i)
    s = s + lis[idx]
print(s + lis[N])

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

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num // 26) + chr(64 + num % 26)

n = int(readline())
print(num2alpha(n).lower())

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7



N = INT()
i = 1
while N > 26**i:
	N -= 26**i
	i += 1

ans = ""
N -= 1
for j in range(i-1, -1, -1):
	ans += ascii_lowercase[N//(26**j)]
	N %= 26**j

print(ans)

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

if __name__ == "__main__":
    n = int(input())
    a = [0]*18
    a[0] = 26
    b = 2
    alpa = ["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"]
    for i in range(1,18):
        a[i] = a[i-1] + 26**b
        b+=1
    d = bisect.bisect_left(a,n)
    ans = "a"*(d+1)
    n = n - a[d-1] -1
    ans = ""
    for i in range(d,-1,-1):
        if i == d:
            ans += alpa[n%(26)]
        else:
            ans += alpa[n%(26)]
        n = n//26
    ans2 = ""
    for i in range(len(ans)):
        ans2 += ans[len(ans)-i-1]
    print(ans2)

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

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

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
      
r = num2alpha(n)
ru = r.lower()
print(ru)

Solution (Python):
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
n = int(input())
print(num2alpha(n).lower())

Solution (Python):
N = int(input())
alpha = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    alpha = chr(ord('a') + remainder) + alpha
print(''.join(alpha))

Solution (Python):
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
    
n = int(input())
ans = num2alpha(n)
print(ans.lower())

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))


def resolve():
    N,=pin()
    ans=[]
    t=0
    
    max_digit=len("1000000000000001")
    ans=[]
    for i in range(max_digit):
        a=(N-1)%26+1
        if a==0:break
        ans.append(a)
        if a==N :
            break
        N=(N-a)//26

    ans.reverse()

    A=""
    for a in ans:
        A+=chr(ord("a")-1+a) 
    print(A)   

resolve()

Solution (Python):
n=int(input())
l=['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']
z=[]
while n>26:
  r=n%26
  n=n//26
  if r==0:
    n-=1
  z.append(r)
z.append(n)
s=''
for x in z:
  let=l[x-1]
  s=let+s
print(s)

Solution (Python):
a=int(input())
b=[]
while a>26:
    c=a%26
    b.append(c)
    a=(a-1)//26

ans=""
b.append(a)
b=b[::-1]
for i in b:
    if i==0:
        ans+="z"
    else:
        ans+=chr(i+96)

print(ans)

Solution (Python):
import math
n = int(input())
name = ""

while n >= 1 / 26:
    div = n % 26
    if div == 0:
        div = 26
    name = chr(div + 64) + name
    n = math.floor((n - div) / 26)
print(name.lower())

Solution (Python):
AL="abcdefghijklmnopqrstuvwxyz"
keta=[0,26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286, 99246114928149462, 2580398988131886038]
kata=[1, 26, 676, 17576, 456976, 11881376, 308915776, 8031810176, 208827064576, 5429503678976, 141167095653376, 3670344486987776, 95428956661682176]
n=int(input())
for i in range(12):
    if(n<=keta[i]):
        s=i
        sn=n-keta[s-1]
        break

def check(n,zn):
    tani = kata[zn]
    for i in range(1,27):
        if(tani*i>=n):
            moji=AL[i-1]
            n-=tani*(i-1)
            break
    return (n,moji)

for i in range(s-1,-1,-1):
    (sn,a)=check(sn,i)
    print(a,end="")

Solution (Python):
N = int(input())
name = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    name = chr(ord('a') + remainder) + name
print(''.join(name))

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

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

print (num2alpha(n).lower())

Solution (Python):
n = int(input())
l = []
while n != 0:
	a = n % 26
	l.append(a)
	n = n // 26
s = ""
c = ["", "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"]
for i in range(len(l)):
	if l[i] == 0:
		if i != len(l)-1:	
			for j in range(i+1, len(l)):
				if l[j] != 0:
					for k in range(i+1, j):
						l[k] = 25
					l[j] -= 1
					s = "z" + s
					break
	else:
		s = c[l[i]] + s
print(s)

Solution (Python):
def num2alpha(num):
    if num<=26:
        return chr(96+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(122)
    else:
        return num2alpha(num//26)+chr(96+num%26)

print(num2alpha(int(input())))

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

S = 'abcdefghijklmnopqrstuvwxyz'

def bite(X):
    s = 0
    t = 0
    while t < X:
        t = t + 26**(s+1)
        s = s + 1
    return s


B = bite(N)
X = N
L = []
for i in range(B):
    if X%26 != 0:
        L.append(X%26)
        X = (X-X%26)//26
    else:
        L.append(26)
        X = (X - 26)//26

L.reverse()

ans = ''
for i in range(B):
    ans = ans + S[L[i]-1]

    
print(ans)

Solution (Python):
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
ans = ''
while N != 0:
    y = N%26
    if y == 0:
        ans = a[-1] + ans
        N = N//26 - 1
    else:
        ans = a[y-1] + ans
        N = N//26 
print(ans)

Solution (Python):
n = int(input())
c = 1
tmp = 26
while tmp < n:
    tmp += 26**(c + 1)
    c += 1
ans = ''
for i in range(c):
    a = n % 26
    if a == 0:
        a = 26
    ans = chr(a + 96) + ans
    n = (n - a) // 26
print(ans)

Solution (Python):
from sys import stdin




def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def si(): return stdin.readline().rstrip()
def lsi(): return list(si())

res=['Yes', 'No']



test_case=1
while test_case:
    test_case-=1



    n=ii()
    a=[]
    z=26
    while n:
        x=n%26
        n//=z
        if not x:
            p='z'
            n-=1
        else:
            p=chr(96+x)
        a.append(p)
    print(*a[::-1], sep='')

Solution (Python):
n=int(input())
ei="$abcdefghijklmnopqrstuvwxyz"
fla=[]
flaa=[0]
ans=""
cnt=2

for i in range(1,20):
    fla.append(26**i)
    flaa.append(flaa[i-1]+26**i)
for i in range(20):
    if n<=flaa[i]:
        k=i
        break

if k==1:
    print(ei[n])
    exit()

b=n-flaa[k-1]

while len(ans)!=k-1:
    for i in range(1,27):
        if fla[k-cnt]*i>=b:
            ans+=str(ei[i])
            b-=fla[k-cnt]*(i-1)
            cnt+=1
            
            break
ans+=str(ei[b])

print(ans)

Solution (Python):
entierAConvertir = int(input())
baseArrivee= 26 
sortie = []
while entierAConvertir>0:
  reste = entierAConvertir % baseArrivee
  if reste==0:
    reste = 26
  sortie.append(reste)
  entierAConvertir-=reste
  entierAConvertir = (entierAConvertir//baseArrivee)
for i in range(len(sortie)):
  print(chr(sortie[len(sortie)-1-i]+ord('a')-1),end="")

Solution (Python):
import sys
n=int(input())
alphabet="abcdefghijklmnopqrstuvwxyz"
l=[]
a=1
sm=0
for i in range(15):
    a*=26
    sm+=a
    l.append(sm)

for i in range(len(l)):
    if n<=l[i]:
        cl=i
        break

if cl==0:
    print(alphabet[n-1])
    sys.exit()
ans=""
n-=l[cl-1]


for i in range(cl):
    num=(n-1)//(26**(cl-i))
    ans=ans+alphabet[num]
    n-=(26**(cl-i))*num

if n!=0:
    ans=ans+alphabet[n-1]
else:
    ans=ans+"z"
print(ans)

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

x = []
for i in range(1, 11):
    x.append(26 ** i)

count = 1

for i in x:
    if n > i:
        n = n - i
        count += 1

def base26(value): 
    x = 26
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    result = []
    tmp = int(value)
    while tmp >= x:
        result.append(str(tmp%x))
        tmp = int(tmp / x)
    result.append(str(tmp%x))
    return result

alp = [
    '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'
]

ans = base26(n-1)
ans2 = ['a'] * count

for i in range(len(ans)):
    ans2[i] = alp[int(ans[i])]

ans2 = list(reversed(ans2))

print(''.join(ans2))

Solution (Python):
N = int(input())
M = 26
tmp = N
out = ''
while tmp > 0:
    res = tmp % M
    if res == 0:
        c = "z"
        tmp -= 26
    else:
        c = chr(ord('a') + tmp % M - 1)
    out = str(c) + out
    tmp = int(tmp/M)
print(out)

Solution (Python):
n=int(input())
t=1
a=[]
x=[]
while True:
    if n<=(26**t-1)*26//25:
        break
    t+=1


n=n-(26**(t-1)-1)*26//25-1
for i in range(t-1,0,-1):
    a.append(n//(26**i))
    n=n%(26**i)
a.append(n)

for i in range(len(a)):
    x.append(chr(a[i]+97))
print("".join(x))

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

def NumToAlpha(n):
    if n<=26:
        return chr(96+n)
    elif n%26==0:
        return NumToAlpha(n//26-1)+chr(122)
    else:
        return NumToAlpha(n//26)+chr(96+n%26)
        
N = NumToAlpha(n)
print(N)

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

Solution (Python):
a=[26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286]
n=int(input())
k=0
for i in range(10):
    if n<=a[i]:
        k=i+1
        break
else:
    k=11
if k==1:
    print(chr(n+96))
else:
    ans=""
    n=n-a[k-2]-1
    for i in range(k):
        if i!=k-1:
            ans+=chr(n//(26**(k-1-i))+97)
            n=n%(26**(k-1-i))
        else:
            ans+=chr(n%26+97)
    print(ans)

Solution (Python):
N=int(input())
a=N//27
b=N%27
s=''
if N<27:
  print(chr(N+96))
else:
  n=N
  j=0
  for i in range(1,11):
    if n-1-pow(26,i)>=0:
      n-=pow(26,i)
      j=i
    else:
      break
  for k in range(j,-1,-1):
    if k==0:
      s=s+chr(n-1+97)
    else:
      s=s+chr((n-1)//pow(26,k)+97)
      n-=((n-1)//pow(26,k))*pow(26,k)
  print(s)

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

name = ''
next_N = N
for i in range(11):
    m = next_N % 26
    next_N //= 26

    if m > 0:
        name = chr(0x60 + m) + name
    elif m == 0:
        name = 'z' + name
        next_N -= 1

    if next_N <= 0:
        break

print(name)

Solution (Python):
def num2alpha(num):
  if num<=26:
    return chr(64+num)
  elif num%26==0:
    return num2alpha(num//26-1)+chr(90)
  else:
    return num2alpha(num//26)+chr(64+num%26)

if __name__ == "__main__":
  N = int(input())
  name = num2alpha(N)
  print(name.lower())

Solution (Python):
N = int(input())
name = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    name = chr(ord('a') + remainder) + name
print(''.join(name))