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):
import itertools as it
import bisect
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())-1
x=[0]+[26**i for i in range(1,20)]
y=list(it.accumulate(x))
keta=bisect.bisect_left(y,n)

number=n-y[keta-1]


ll=[]
for i in range(keta):
  u=number//(26)**(keta-i-1)
  ll.append(u+1)
  
  number-=u*((26)**(keta-i-1))
ans=list(num2alpha(i).lower() for i in ll)

if n!=0:
   print(*ans,sep="")  
else:
  print("a")

Solution (Python):

import sys
n=int(input())
p=n
a=[]
cnt=0

if n<=26:
    print(chr(n+96))
    sys.exit()
while p>0:
    p=p//26
    cnt+=1



for i in range(cnt-1):
    q,r=divmod(n,26**(cnt-i-1))
    a.append(q)
    n=r
if n<=25:
    a.append(n)
    
    

for i in range(len(a)-1,0,-1):
    if a[i]<=0:
        a[i]+=26
        a[i-1]-=1


flag=True
j=0
while flag:
    if a[j]==0:
        j+=1
    else:
        flag=False
a=a[j:]
        
eigo=[chr(i) for i in range(97,123)]    
for i in a:
    print(eigo[i-1],end="")

Solution (Python):
n = int(input())
nam = ""
flag = True
while(flag):
    k = n % 26
    if n <= 26: flag = False
    if k == 0: k = 26
    nam = chr(96 + k) + nam
    n = (n - k) // 26
print(nam)

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 = [chr(i) for i in range(97, 97+26)]
i = 0
s = 0
while True:
    i  += 1
    if (n-1) //(26**i+s) < 1: 
        break
    s = s + 26**i 
t_turn = n-s 
ans =""
for j in range(i,0,-1):
    ans += alpha[((t_turn-1)//(26**(j-1)))]
    t_turn = t_turn-((t_turn-1)//(26**(j-1)))*(26**(j-1))
print(ans)

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


def n2a(n):
    if n == 0:
        return "z"
    n += 96
    return chr(n)


res = ""

while N > 0:
    t = N % 26
    res = n2a(t) + res
    N //= 26
    if t == 0:
        N -= 1

print(res)

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

N -= 1
a = list()
alpha = [i for i in 'abcdefghijklmnopqrstuvwxyz']
if N < 26:
    a.append(alpha[N])
else:
    while N > 0:
        sho = N // 26
        amari = N % 26
        a.append(alpha[amari])
        N = N // 26 - 1
    if N == 0:
        a.append(alpha[N])
a.reverse()
print(''.join(a))

Solution (Python):

"""
@author: H_Hoshigi
"""
import string

def decimal_to_26(N):
    number_list = []
    while True:
        number_list.append(N%26)
        N = N//26
        if N == 0:
            if number_list[-1] == 0:
                number_list.pop(-1)
            break
    number_list = number_list[::-1]
    N_26_str = "".join(
        [string.ascii_lowercase[i] for i in number_list]
    )
    return N_26_str

def main():
    N = int(input())
    N -= 1

    counter = 1
    while N >= pow(26, counter):
        N -= pow(26, counter)
        counter += 1
    
    N_26_str = decimal_to_26(N)
    answer = "a"*(counter-len(N_26_str))+N_26_str
    print(answer)

if __name__ == "__main__":
    
    main()

Solution (Python):
n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
result = ''
ans = 0

while n > 0:
    if n % 26 == 0:
        ans = 25
    else:
        ans = n % 26 - 1
    result = alphabet[ans] + result
    n = (n-ans) // 26

print(result)

Solution (Python):
def convert(a,b):
    if (int(a/b)):
        return convert(int(a/b), b)+str(a%b)
    return str(a%b)

def main():
    N=int(input())
    m=0
    ans=[]
    l=['z','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']
    while True:
        m=N%26
        ans.append(l[m])
        if m==0: N-=26
        else: N-=m
        N=N//26
        if N==0: break
    ans.reverse()
    print(''.join(ans))
    return

if __name__=='__main__':
    main()

Solution (Python):
n = int(input())
i = 1
str_list = [chr(i) for i in range(97, 97+26)]
ans =str()

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

for j in range(i):
    ans = str_list[n%26] + ans
    n //= 26

print(ans)

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):

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())
S = ""
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"]
while N>26:
    N-=1
    S=Alpha[N%26]+S
    N=N//26
N-=1
S=Alpha[N%26]+S
print(S)

Solution (Python):
def base(n, b):
    d="abcdefghijklmnopqrstuvwxyz"
    s = []
    while True:
        s.append(d[n % b])
        n = n//b -1
        if n < 0:
          break
    return ''.join(reversed(s))
print(base(int(input())-1,26))

Solution (Python):
import string

def main():
  N = int(input())
  az = string.ascii_lowercase
  d = 26
  ans = ""

  while(N > 0):
    m = (N-1) % d
    ans = az[m] + ans
    N = (N-1) // d
    
  print(ans)


if __name__ == "__main__":
  main()

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

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

revarr = arr[::-1]
ans = ""


for i in revarr:
    ans += dicts[i]
print(ans)

Solution (Python):
N = int(input())
a = ['z']
for i in range(25):
    a.append(chr(0x61 + i))
l = []
for i in range(20):
    x = N % 26
    l.append(a[x])
    N = N // 26
    if x == 0:
        N -= 1
    if N == 0:
        break

print("".join(reversed(l)))

Solution (Python):
n=int(input())
s=''
i=0
a=[]
while n>0:
    t=n%26

    if t==0:
        s+='z'
        n=n//26-1
    else:
        s+=chr(t-1+ord('a'))
        n=n//26
print(s[::-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)
      
ans = num2alpha(n)
print(ans.lower())

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

while True:
  n -= 1
  x = divmod(n,26)
  ans = ans + chr(ord('a')+x[1])
  
  n = n - x[1]
  n = n // 26
  if n == 0:
    break
    
ans = ans[::-1]
print(ans)

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



a = 1
baisu = []
ruiseki = [26]

for i in range(11):
    a *= 26
    baisu.append(a)
    if i != 0:
        ruiseki.append(ruiseki[i-1]+a)


length = 0
new_N = 0
f = True
for i,rui in enumerate(ruiseki):
    if N <= rui:
        length = i+1
        if i!=0:
            new_N = N-ruiseki[i-1]
        else:
            new_N = N
        f = False
        break
if f:
    new_N = N-ruiseki[-1]









ans = []
for i in range(length):
    u = 0
    cnt = 0
    while(1):
        if new_N <= 26 and i==length-1:
            ans.append(new_N-1)

            break
        pre_u = u
        u += baisu[length - i -2 ]
        if new_N <= u:
            ans.append(cnt)
            new_N -= pre_u
            break
        cnt += 1

alp = [chr(ord('a') + i) for i in range(26)]
ans_c = ""


for an in ans:
    ans_c+=alp[an]
print(ans_c)

Solution (Python):
n=int(input())
num=26
data=[]
while num<=n:
    if n%num==0:
        data.append("z")
        n=int(n/num-1)
    else:
        data.append(chr(n%26+96))
        n=int(n/num)
if n!=0:
    data.append(chr(n+96))
data="".join(data)
print(data[::-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']
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):
ascii = 96
N = int(input())
name = ''
while 1:
    q, mod = divmod(N, 26)
    
    if mod == 0:
        name += 'z'
    else:
        name += chr(ascii+mod)
    
    if q >= 0 and q <= 26:
        if mod == 0:
            q -= 1
        if q > 0:
            name += chr(ascii+q)
        break
    else:
        if mod == 0:
            N = q - 1
        else:
            N = q

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

Solution (Python):
def to_alphabet(n):
    S = "abcdefghijklmnopqrstuvwxyz"
    if (n - 1) // 26:
        return to_alphabet((n - 1) // 26) + S[(n - 1) % 26]
    return S[(n - 1) % 26]

n = int(input())
print(to_alphabet(n))

Solution (Python):
def main():
    n = int(input())
    res = ''
    d = 1
    base = []
    alp = 'abcdefghijklmnopqrstuvwxyz'
    for b in range(12):
        mod = n % 26
        if mod == 0:
            mod = 26
        res = alp[mod-1] + res
        if n - mod == 0:
            break
        else:
            n = int((n - mod) / 26)
            
    print(res)




if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
Norigin = N
alphabet = "abcdefghijklmnopqrstuvwxyz"
j = 0
start = 0
end = 0
while 1:
    if N <= 0:
        end = start + 26**(j)
        break
    else:
        start += 26**j
        j += 1
        N -= 26**j
ans = []
Norigin = Norigin-start
for i in range(j):
    ans.append(alphabet[Norigin % 26])
    Norigin = Norigin//26
ans.reverse()
print("".join(ans))

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)


def main():
    N = int(input())

    print(num2alpha(N).lower())


if __name__ == "__main__":
    main()

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

AlList = {0:'Z', 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'}

result = ''

while 'true':
    if N > 26:
        tmp = N % 26
        result = AlList[tmp] + result
        N //= 26
        if tmp == 0:
            N -= 1
    else:
        result = AlList[N] + result
        break
print(result.swapcase())

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)

n = input()
n = int(n)

ans = num2alpha(n)

print(ans)

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



l=[chr(i) for i in range(97,123)]

ans=""
i=1
while True:
    if i==1:
        if n%26!=0:
            x=n%26
            n=n//26
        else:
            x=n%26
            n=n//26 -1
    else:
        if n%26!=0:
            x=n%26
            n=n//26
        else:
            x=n%26
            n=n//26 -1
    ans+=l[x-1]
    
    i+=1
    if n==0:
        break
ans=ans[::-1]
print(ans)

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

k = list()
while(N >= 27):
  a = int(N%26)
  if a==0:
    a =26
  k.insert(0,a)
  N = (N-a)/26

k.insert(0,int(N))
ans = str()
for i in range(len(k)):
  x = k[i] + 64 +32
  ans = ans + str(chr(x))

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
from collections import *

N = int(input())
l = [0, 26]

for i in range(30):
    l.append(l[-1]*26)

for i in range(len(l)):
    if N-l[i]>0:
        N -= l[i]
    else:
        keta = i
        break

ans = []
alpha = 'abcdefghijklmnopqrstuvwxyz'

for i in range(keta):
    for j in range(26):
        if N-pow(26, keta-1-i)>0:
            N -= pow(26, keta-1-i)
        else:
            ans.append(j)
            break

ans2 = []

for i in ans:
    ans2.append(alpha[i])

print(''.join(ans2))

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())
p=num2alpha(n)
p=p.lower()
print(str(p))

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

def dfs(N):
    n, r = divmod(N-1, 26)
    ans.append(alp[r])
    if N <= 26:
        return (n, r)
    return dfs(n)

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

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(str.lower(num2alpha(n)))

Solution (Python):

alpha = "abcdefghijklmnopqrstuvwxyz"

N = int(input())

dog_name = ""

while N > 0:
    dog_name += alpha[(N-1)%26]
    N = (N-1) // 26

dog_name = dog_name[::-1]

print(dog_name)

Solution (Python):

a_list = ['z'] + [chr(ord('a') + i) for i in range(25)]

def get_alphabet(c: int, s: str) -> str:
    s += a_list[c % 26]
    if c / 26 <= 1:
        return s
    else:
        c = (c - 1) // 26 if c / 26 >= 1 else c // 26
        return get_alphabet(c, s)

n = int(input())

ans = get_alphabet(n, '')

print(''.join(reversed(ans)))

Solution (Python):
N=int(input())
tmp=26
for i in range(1,1000):
    if N<=tmp:
        nl=i
        break
    else:
        tmp+=26**(i+1)


x=N-tmp+26**nl
ans=[]
alp=[chr(i) for i in range(97, 97+26)]

for i in range(nl-1,-1,-1):   
    for j in range(1,27):
        if j*(26**i)>=x:
            ans.append(alp[j-1])
            x-=(j-1)*(26**i)
            break
print("".join(ans))

Solution (Python):
num2alpha = lambda c: chr(c+64).lower()

N = int(input())
res = list()

while True:
  mod = N % 26
  if mod == 0:
      mod = 26

  res.insert(0,num2alpha(int(mod)))
  N = N // 26
  if mod == 26:
    N -= 1
  if N <= 0:
    break

print(''.join(res))

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




if N <= 26:
    print(chr(96 + N))
else:
    ans = list()

    while 1:
        if N%26 != 0:
            ans.append(chr(96 + N%26))
        else:
            ans.append("z")
            N -= 1
        N = N//26

        if N <= 26:
            if N%26 != 0:
                ans.append(chr(96 + N%26))
            else:
                ans.append("z")

            break

    print(''.join(map(str, ans[::-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)
ans=num2alpha(n).lower()

print(ans)

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

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

Solution (Python):


alphabet = "abcdefghijklmnopqrstuvwxyz"

def alphabet_decimal(n):
    def convert(n):
        while n > 0:
            yield alphabet[(n - 1) % len(alphabet)]
            n = (n - 1) // len(alphabet)
    return ''.join(convert(n))[::-1]

if __name__ == '__main__':
    N = int(input())
    print(alphabet_decimal(N))

Solution (Python):
N = int(input())
base = ord('a')
r = []
q = N
for i in range(12):
    if q <= 26:
        r.append(q)
        break
    if q % 26 == 0:
        r.append(26)
        q = q // 26 - 1
    else:
        r.append(q % 26)
        q = q // 26
r.reverse()
ans = [chr(i+base-1) for i in r]
print(''.join(ans))

Solution (Python):
import sys
from itertools import permutations as pm
si = sys.stdin.readline
abc = 'abcdefghijklmnopqrstuvwxyz'


def former(i, n):
    s = ''
    for _ in range(i):
        s += abc[n % 26]
        n //= 26
    s = s[::-1]
    print(s)


def main():
    n = int(si())
    size = 26
    i = 1
    while n > size:
        n -= size
        size *= 26
        i += 1
    if i == 1:
        print(abc[n-1])
    else:
        former(i, n-1)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	n = I()
	alphabets = [chr(ord('a')+i) for i in range(26)]
	mod_list = []
	while n > 26:
		mod_list.append(n % 26)
		n = n // 26
	if n > 0:
		mod_list += [n]
	ans = ''
	def minus_one(i):
		if mod_list[i] != 0:
			mod_list[i] -= 1
		else:
			minus_one(i+1)
			mod_list[i] = 25
		return mod_list[i]
	for i in range(len(mod_list)):
		if i < len(mod_list) -1 or mod_list[i] > 0:
			ans = alphabets[minus_one(i)] + ans
	print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
d={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'}
l=[]
p=10
while p!=-1:
    a=n//26**p
    l.append(a)
    n-=a*26**p
    p-=1

for i in range(len(l)):
    if l[i]!=0:
        break
l=l[i:]
for j in range(12):
    for k in range(len(l)):
        if l[k]==0:
            if k!=0:
                
                l[k]=26
                if 0<=k-1<=len(l)+1:
                    l[k-1]-=1

m=""
for i in l:
    if i!=0:
        
        m+=d[i]
print(m)

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


def getNameFromNumber(num):
    amari = (num - 1) % 26
    char = chr(97 + amari)
    div = (num - 1) // 26
    if div > 0:
        return getNameFromNumber(div) + char
    else:
        return char


print(getNameFromNumber(n))

Solution (Python):
n=int(input())
ls_1 = []
for i in range(1,12):
  ls_1.append(int((26**i-1)/25))

pos = 0
for i in ls_1:
  if n < i:
    pos = ls_1.index(i)-1
    break
  elif n > 146813779479511:
    pos = 10
n_ = n-ls_1[pos]

ans = [97]*(pos+1)

ls_2 = []
for i in range(pos+1):
  ls_2.append(n_%26)
  n_ //= 26
  if n_==0:
    ls_2 = ls_2+[0]*(pos-i)
    break

ls_2=ls_2[::-1]
for i in range(len(ans)):
  ans[i] = chr(ans[i]+ls_2[i])
print("".join(ans))

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

n_c = n - 1
w_dict = {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"}
out = ""
while n_c > 25:
    out = out + w_dict[n_c % 26]
    n_c = n_c // 26 - 1

out = out + w_dict[n_c]
print(out[::-1])

Solution (Python):



def number_to_alphabet(number):
    if number <= 26:
        return chr(96 + number)

    if number % 26 == 0:
        return number_to_alphabet(number // 26 - 1) + 'z'

    return number_to_alphabet(number // 26) + chr(96 + number % 26)


N = int(input())
result = number_to_alphabet(N)
print(result)

Solution (Python):
n=int(input())
ans=str()
j=0
m=[" ","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"]
while n!=0 or j==0:
    x=n%26
    if x == 0:
        x=26
        n-=1
    ans=m[x]+ans
    if n==26:
        break
    n//=26
    j=1
print(ans)

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

count = 0
num = []

N -= 1

while 1:
  
  if N // 26 != 0:
    count += 1
    if N % 26 == 0 and count != 1:
      num.append(26)
      N //= 26
      N -= 1
    else:
      num.append(N % 26)
      N //= 26
  else:
    if N == 0:
      break
    else:
      num.append(N % 26)
      break
  	
ans = ''
  	
for i in range(len(num)):
  if i == 0:
  	ans += chr(97 + num[i])
  else:
    ans += chr(96 + num[i])
  
if n == 1:
  print('a')
else:
  print(ans[::-1])

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

nlist=[]
while N:
  nlist.append((N-1)%26)  
  N=(N-1)//26
  
nlist.reverse()


answer_list=[]
for n in nlist:
  answer_list.append(chr(97+n))
  
print("".join(answer_list))

Solution (Python):
N = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = s[(N-1)%26]
N -= (N-1)%26
for i in range(25):
    if N < 26:
        break
    N = N//26
    ans = s[(N-1)%26] + ans
    N -= (N-1)%26

print(ans)

Solution (Python):
char_list = [ chr(ord('a')+num) for num in range( 26 ) ]
N = int(input())

def Base_10_to_n(X, n):
    if X % n != 0 and (int(X//n)):
        return Base_10_to_n(int(X//n), n)+str(char_list[((X%n)-1)%n])
    elif X % n == 0 and (int(X//n)):
        if X//n == 1:
            return str(char_list[((X%n)-1)%n])
        else:
            return Base_10_to_n(int((X-1)//n), n)+str(char_list[((X%n)-1)%n])
    return str(char_list[((X%n)-1)%n])

print(Base_10_to_n(N,26))

Solution (Python):
a = int(input())
sr_1 = 'abcdefghijklmnopqrstuvrxyz'

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(a).lower())

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

def routine(X, n):
   div = X//n if X % n > 0 else X//n - 1
   if div:
      return routine(div, n)+a2z[X%n-1]
   return a2z[X%n-1]

print(routine(int(input()), 26))

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

ans = ''
D = {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'}
while True:
    N = N-1
    ans = ans+D[N%26]
    N = N//26
    if N == 0:
        break
    elif N <= 26:
        N = N-1
        ans += D[N%26]
        break
print(ans[::-1])

Solution (Python):


def main():
    n = int(input())
    n -= 1
    name = ''
    abc = 'abcdefghijklmnopqrstuvwxyz'

    i = 1
    while n >= 0:
        q, r = divmod(n, 26)
        name = abc[r] + name
        n = q - 1
        i += 1
    print(name)


if __name__ == '__main__':
    main()

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

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

print(solver(n))

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())

def trans(t): 
    alph = 'abcdefghijklmnopqrstuvwxyz'
    return alph[t]

ans = ''
i=n
while i > 0:
    s = (i-1) % 26
    i = (i-1) //26
    ans = trans(s) + ans

print(ans)

Solution (Python):
n = int(input())
res = ""
for i in range(1,100):
    a = n % 26
    if n <= 26:
        break

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

Solution (Python):
n = int(input())
n -= 1
i = 1
temp = 0
while temp <= n:
    temp += 26**i
    i += 1
temp -= 26**(i-1)

R = n-temp


ans = []
for k in range(i-1):
    q, r = divmod(R, 26)
    ans.append(chr(r+ord('a')))
    R = q

ans.reverse()
print(''.join(ans))

Solution (Python):

import sys
import string

def solve(N: int):
    alphabet = string.ascii_lowercase
    digits = []
    nextDigits = []
    last = 0
    for i in range(1000):
        nd = 26**i + last
        last = nd
        if nd <= N:
            digits.append(nd)
            nextDigits.append(26**i)
        else:
            break
    
    s = ""
    
    for i in range(len(digits)-1,-1,-1):
        isFirstDigit = i == len(digits)-1
        if isFirstDigit:
            currentBaseNum = digits[i]
            index = (N-currentBaseNum)//nextDigits[i]
            s += alphabet[index]
            N = N - currentBaseNum - index * nextDigits[i]
        else:
            index = N //nextDigits[i]
            s+= alphabet[index]
            N = N - index * nextDigits[i]
    return s







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

if __name__ == '__main__':
    main()

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(str.lower(num2alpha(N)))

Solution (Python):

def resolve():
  N = int(input())
  N_to_str = ""
  alphabet_list = "zabcdefghijklmnopqrstuvwxyz"
  
  while N > 0:
    N-=1
    N_to_str=alphabet_list[N%26+1]+N_to_str
    
    
    N = (N-N%26)//26
  print(N_to_str)

if __name__ == "__main__":
  resolve()

Solution (Python):
n = int(input())-1
s = n//26
t = n%26
a = [chr(i) for i in range(97,97+26)]
if s == 0:
    ans = a[t]
elif s < 27:
    ans = a[s-1]+a[t]
else:
    s2 = (s-1)//26
    t2 = s%26
    if s2 < 27:
        ans = a[s2-1] + a[t2-1] + a[t]
    else:
        s3 = (s2-1)//26
        t3 = s2%26
        if s3 < 27:
            ans = a[s3-1] + a[t3-1] + a[t2-1] +a[t]
        else:
            s4 = (s3-1)//26
            t4 = s3%26
            if s4 < 27:
                ans = a[s4-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t] 
            else:
                s5 = (s4-1)//26
                t5 = s4%26
                if s5 < 27:
                    ans = a[s5-1] + a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t] 
                else:
                    s6 = (s5-1)//26
                    t6 = s5%26
                    if s6 < 27:
                        ans = a[s6-1] + a[t6-1]+ a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t]
                    else:
                        s7 = (s6-1)//26
                        t7 = s6%26
                        if s7 < 27:
                            ans = a[s7-1] + a[t7-1]+ a[t6-1]+ a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t]
                        else:
                            s8 = (s7-1)//26
                            t8 = s7%26
                            if s8 < 27:
                                ans = a[s8-1] + a[t8-1]+ a[t7-1]+ a[t6-1]+ a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t]
                            else:
                                s9 = (s8-1)//26
                                t9 = s8%26
                                if s9 < 27:
                                    ans = a[s9-1] + a[t9-1]+ a[t8-1]+ a[t7-1]+ a[t6-1]+ a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t]
                                else:
                                    s10 = (s9-1)//26
                                    t10 = s9%26
                                    if s10 < 27:
                                        ans = a[s10-1] + a[t10-1] + a[t9-1]+ a[t8-1]+ a[t7-1]+ a[t6-1]+ a[t5-1] + a[t4-1] + a[t3-1] +a[t2-1] +a[t] 
               
print(ans)

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']
name=''
for _ in range(11):
    name=alpha[N%26-1]+name
    if N<=26:
        break
    N=(N-1)//26

print(name)

Solution (Python):

s = "abcdefghijklmnopqrstuvwxyz"

def fA(N):
  if N <= 26: return s[N-1]
  a = (N-1) // 26
  b = N % 26

  return fA(a) + fA(b)

N = int(input())
print(fA(N))

Solution (Python):
n=int(input())-1
j=26
while j<=n:
  n-=j
  j*=26
j//=26
ret = ""
while j:
  ret += "abcdefghijklmnopqrstuvwxyz"[n//j]
  
  n %= j
  j //= 26
print(ret)