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):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False


ret = []

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n) + ',' +str(X%n)
    return str(X%n)

def main():
    N = I()

    l = 0
    c = 1
    cur = N
    last = cur
    while True:
        cur -= 26 ** c
        c += 1
        if cur < 0:
            break
        last = cur

    if last == 0:
        l = c - 2
        
        d = Base_10_to_n(last, 25).split(',')
        

        print(l * 'z')
    else:
        l = c - 1
        ans = []

        last -= 1

        if last == 0:
            print(l * 'a')
            return

        while last > 0:
            
            r = last % 26
            last //= 26
            
            
            ans.append(l_alp[r])

        while len(ans) < l:
            ans.append('a')
        ans = ans[::-1]
        temp = ''
        for a in ans:
            temp += a
        print(temp)
    

    
    
    
    
    

            

    
    
    

    

    
    

    


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'

total = []
for i in range(1, 12):
    total.append(int(26 * (26 ** i - 1) / 25))

digits = 1
for i in range(11):
    if N > total[i]:
        digits += 1
    else:
        break



if digits > 1:
    N -= total[digits-2]

N -= 1

ans = [0] * digits


rem = N
for i in range(digits, 1, -1):
    if rem > 26 ** (i-1):
        ans[digits-i] = rem // 26 ** (i-1)
        rem = rem % (26 ** (i-1))

ans[digits-1] = rem
name = []

for digits in ans:
    name.append(alphabet[digits])

for s in name:
    print(s, end="")

Solution (Python):
n = int(input())
x = "abcdefghijklmnopqrstuvwxyz"
s = ""
while True:
  if n%26 == 0:
    s = "z"+s
    n -= 26
    n =n//26
  else:
    s = x[n%26-1]+s
    n = n//26
  if n==0:
    break
print(s)

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

while N > 26:
	N, mod = divmod(N-1, 26)
	ans = chr(ord('a')+mod) + ans

ans = chr(ord('a')+(N-1)%26) + ans

print(ans)

Solution (Python):
num=int(input())
rem=[]
while(num):
    if num%26>0:
        rem.append(num%26)
    else:
        rem.append(26)
        num-=1
        
    num=num//26
    if num >=1 and num <=26:
        print(chr(96+num),end="")
        break
  
for i in range(len(rem)-1,-1,-1):
  print(chr(96+rem[i]),end="")

Solution (Python):


if __name__ == "__main__":
    n = input()
    char_string = "qazwsxedcrfvtgbyhnujmikolp"
    char_list = sorted(list(char_string))

    n = int(n)
    result_string = ""
    while 1:
        if n <= 26:
            break
        result_string = char_list[int((n%26)-1)] + result_string
        if (n % 26) == 0:
            n = n//26-1
        else:
            n = n//26
    result_string = char_list[n-1] + result_string
    print(result_string)

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

alpha_list=[]
for i in range(97,97+26):
    alpha_list.append(chr(i))    

for i in range(11):
    tmp_max=tmp_max+26**(i+1)
    if N <= tmp_max:
        keta=i+1
        mx=tmp_max
        mn=tmp_max-26**(i+1)+1
        break

ans=['a']*keta

ans[keta-1]=alpha_list[(N-mn)%26]

tmp=(N-mn)
for _ in range(keta-1):
    tmp=tmp//26
ans[0]=alpha_list[tmp]

tmp_keta=keta-2
count=1
while tmp_keta>0:
    tmp=(N-mn)
    for _ in range(count):
        tmp=tmp//26
    tmp=tmp%26
    ans[tmp_keta]=alpha_list[tmp]
    count=count+1
    tmp_keta=tmp_keta-1

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

Solution (Python):
import collections
n = int(input())
deq = collections.deque()
ls = ["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","a"]
if n == 1:
    print("a")
else:
    n -= 1
    while n > 0:
        deq.appendleft(n%26)
        n //= 26
    ans = ""
    
    for i in range(len(deq)-2,0,-1):
        if deq[i] <= 0:
            deq[i-1] -= 1
            deq[i] += 26
    
    for i in range(len(deq)):
        if i != len(deq)-1:
            if deq[i] != 0:
                ans += ls[deq[i]-1]
        else:
            ans += ls[deq[i]]
    print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

import string
from collections import deque

name_table = 'z' + string.ascii_lowercase
ans = deque()


while n > 0:
    q = n // 26
    m = n % 26
    ans.appendleft(name_table[m])
    if m == 0:
        n = q - 1
    else:
        n = q

print(''.join(ans))

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

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

ans=''
last=0

keta=1

while True:
    if last+26**keta>n:
        for i in range(keta):
            idx=n%26
            n//=26
            ans+=chr(97+idx)
        break
    n-=26**keta
    keta+=1
print(ans[::-1])

Solution (Python):
n = int(input())
i = 1
ssum = 0
while n > ssum + 26**i:
    ssum += 26**i
    i += 1
alp = ['z'] + [chr(i) for i in range(97,97+26)]
ans = ''
import math
for j in range(1,i):
    n -= 26**j
for j in range(1,i+1):
    
    
    ans +=alp[n%26]
    ss = alp[n%26]
    
    n += 26-n%26
    n //= 26
    if ss == 'z':
        n -= 1

print(ans[::-1])

Solution (Python):
import sys
from string import ascii_lowercase
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


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


def getDigit(N):
    x = 26
    i = 1
    while N > x:
        i += 1
        x += 26**i

    return i


def main():
    N = int(input())
    S = ascii_lowercase
    if N < 27:
        print(S[N - 1])
        return
    xdigit = getDigit(N)
    
    tN = N
    for i in range(1, xdigit):
        tN -= 26**i
    
    tN -= 1
    ans = ''

    for _ in range(xdigit):
        ans = S[tN % 26] + ans
        tN //= 26

    print(ans)
    return


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)
    

num = int(input()) 
ans = num2alpha(num)
print(ans.lower())

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

i=0
while N>0:
    a=(N//(26**i))%26
    if a>0:
       list.append(chr(a+96))
       N=N-a*(26**i)
    else:
       list.append("z")
       N=N-26*(26**i)
    i+=1

list2=list[::-1]
ret=''.join(list2)
print(ret)

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

a = "abcdefghijklmnopqrstuvwxyz"
s = ""

while n > 0:
    if n%26 == 0:
        s = a[n%26-1] + s
        n //= 26
        n -= 1
    else:
        s = a[n%26-1] + s
        n //= 26
    
print(s)

Solution (Python):
n=int(input())
for i in range(0,11):
    if n>(26**(i+1)-26)//25:
        idx=i
        k=n-(26**(i+1)-26)//25
ans=[]

while idx>=0:
    for i in range(26):
        if k>i*26**idx:
            s=i
    
    ans.append(chr(s+97))
    k-=s*26**idx
    idx-=1
print("".join(ans))

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

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

alp =  ["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","z"]
name = ""
for i in range (30):
    name = alp[n%26]+name
    if n <=26:
        break
    if n%26 == 0:
        n = int(n/26 -1)
    else:
        n //=26
   

print(name)

Solution (Python):
import math

t = input()
moji_list = {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"}
print_list =[]

def hantei(t):
    global print_list
    try:
        int(t)
    except ValueError:
        return
    else:
        n = int(t)
    
    if 1 <= n and n <= 1000000000000001:
        while(n >= 1):
            s = n % 26
            if s == 0:
                s = 26
            print_list.insert(0, moji_list[s])
            n = math.floor(n / 26)
            if s == 26:
                n -= 1
    else:
        return

hantei(t)
pu = ''.join(print_list)
print(pu)

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

b = n%26
if b == 0:
    ans = "z"
    b = 26
else:    
    ans = chr(b+96)
i = 2
while 1:
    c = chr(((n-b)%26**i)//26**(i-1)+96)
    if ((n-b)%26**i)//26**(i-1) == 0:
        if n == b:
            break
        else:
            ans += "z"
            b += 26**i
    elif c != "`":
        ans += c
        b += (n-b)%26**i
    i += 1
print(ans[::-1])

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

shisu26=[]

def shinhou26(M):
    
    
    amari=M%26
    shisu26.append(amari)
    if M>26:
        if M%26==0:
            M=(M-26)//26
            return M
        else:
            M=(M-M%26)//26
            return M
    elif M==26:
        M=0
        return M
    else:
        M=0
        return M
    

for i in range(15):
    
    N=shinhou26(N)
    if N==0:
        break

shisu26=list(reversed(shisu26))
alp="zabcdefghijklmnopqrstuvwxy"

ans=""
for i in shisu26:
    s=alp[i]
    ans+=str(s)
print(ans)

Solution (Python):
from collections import deque
n = int(input())

a = 0
b = 0
tm = 0
while a < n:
    tm += 1
    b = a
    a += 26 ** tm

def base_10_to_n(x, n, tm):
    A = deque([])
    while x > 0:
        A.appendleft(x%n)
        x = int(x/n)
    if len(A) < tm:
        for i in range(tm - len(A)):
            A.appendleft(0)
    else:
        pass
    return A
    

L = base_10_to_n(n - b - 1, 26, tm)



ans = ''
for i in L:
    ans += chr(i + 97)
print(ans)

Solution (Python):
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']

n = int(input())

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

print(name[::-1])

Solution (Python):
n = int(input())
name = []
eng = 'abcdefghijklmnopqrstuvwxyz'
while n:
  name.append(eng[n % 26-1])
  if n % 26 == 0:
    n = n // 26 - 1
  else:
    n //= 26
print(''.join(reversed(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)

m = num2alpha(n).lower()
print(m)

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):
case = "".join([chr(i) for i in range(97, 123)])
def case_26(n):
    ans = ""
    while n >= 26:
        ans += case[n%26]
        n = n//26 - 1
    ans += case[n]
    return ans
n = int(input())
print(case_26(n-1)[::-1])

Solution (Python):

N = int(input())
alphabet = [chr(ord('a') + i) for i in range(26)]
i = 1
tmp = 0
tmppre = 0
while tmp < N:
    if i == 1:
        tmppre = 0
    else:
        tmppre =tmp 
    tmp += 26**i
    i += 1

i -= 1    
tmp = N - tmppre - 1
ans = []
for j in range(i):
    ans.append(tmp//(26 ** (i-j-1)))
    tmp -= (tmp//(26 ** (i-j-1))) * 26 ** (i-j-1)

ans_alpha = ''
for k in range(len(ans)):
    ans_alpha += alphabet[ans[k]]
    
print(ans_alpha)

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

input_num = int(input())
print(abc(input_num))

Solution (Python):
n = int(input())
m = 1
k = n
s = ''
while True:
    k -= 26**m
    if k > 0:
        m +=1
    else:
        break
n -= 26*(26**(m-1)-1)//25
for i in range(m):
    j = ((n-1)//26**i + 1)
    if j%26 != 0:
        s += chr(j%26+96)
    else:
        s += 'z'
print(s[::-1])

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

s = []
n = N
while True:
    mod = n % 26
    s.append(mod)
    if n // 26 == 0:
        break
    n = (n - mod) // 26

for i in range(len(s)):
    if s[i] == 0 and i != len(s)-1:
        s[i] = 26
        s[i+1] = s[i+1] - 1
    if s[i] == -1:
        s[i] = 25
        s[i+1] = s[i+1] - 1

if s[-1] == 0:
    s = s[:-1]

name = ''
for i in range(len(s)):
    name = 'abcdefghijklmnopqrstuvwxyz'[s[i]-1] + name

print(name)

Solution (Python):
n = int(input())
ans = list()
while n>0:
    x = n % 26
    if x == 0:
        x = 26
        n=n-1
    ans.append(x)
    n = int(n / 26)


str_ans = ""
for x in ans[::-1]:
    str_ans += chr(x+96)

print(str_ans)

Solution (Python):
n=int(input())
t = n
l=[]

while t>0:
 if t%26==0:
  p=26
  l.insert(0,chr(p +96))
 else:
  p=t%26
  l.insert(0,chr(p +96))
 t = (t-p)//26
 
print('' .join(l))

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):
char = 'abcdefghijklmnopqrstuvwxyz'


N=int(input())
stack = 26
bstack = 0
length = 1
while True:
    if stack >=N:
        order = N-bstack-1
        
        counter = 0
        ans = ""
        for i in reversed(range(length)):
            if i == 0:
                ans = ans + char[order]
            elif order > 26**(i):
                div = int(order/26**(i))
                ans = ans + char[div]
                order = order - div*26**(i)
            else:
                ans = ans+ "a"
        print(ans)
        break    


    bstack = stack
    length += 1
    stack = stack+26**length

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

Solution (Python):
from collections import deque
import math


def main():
    n = int(input())
    if n == 1:
        print('a')
        return
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n-1, 26))
    ex = 1
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        if rem == 0:
            if n == 0:
                break
            rem += 26
            n -= aa
        digits.appendleft(chr(alpha + rem))

    [print(d, end='') for d in digits]
    print()


if __name__ == '__main__':
    main()

Solution (Python):
import math

n = int(input())
keta = int(math.log(n)/math.log(26)) + 1
name = [0]*keta

for i in range(keta):
    name[i] = n % 26
    n = n // 26

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

for j in range(keta):
    if name[j] == 0 and j != keta-1:
        name[j] = 26
        name[j+1] -= 1
        ans = alp[name[j]-1] + ans
    elif name[j] == -1 and j != keta-1:
        name[j+1] -= 1
        name[j] += 26
        ans = alp[name[j]-1] + ans
    elif j == keta-1 and name[j] == 0:
        pass
    else:
        
        ans = alp[name[j]-1] + ans


print(ans)

Solution (Python):
alphabet = 'aabcdefghijklmnopqrstuvwxy'
N =int(input())
name = ''
while N > 0:
    n = N % 26
    N = N // 26
    if n == 0:
        name += 'z'
        N = N-1
    else:
        name += alphabet[n]
new_name = name[::-1]
print(new_name)

Solution (Python):




import sys
input = sys.stdin.readline



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

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

    maxdigit = 1
    pre = 0

    while N - pre > 26 ** maxdigit:
        pre += 26 ** maxdigit
        maxdigit += 1


    

    N -= pre

    res = ''

    for d in range(1,maxdigit+1):
        for i in range(26):
            if N <= 26 ** (maxdigit - d) * (i + 1):
                res += alf[i]
                N -= 26 ** (maxdigit - d) * i
                break

    print(res)



main()

Solution (Python):
s='abcdefghijklmnopqrstuvwxyz'
n=int(input())
res=[]
n=n-1
while n>=0:
    res.append(n%26)
    n=n//26
    n=n-1
    
ans=''
for j in range(len(res)-1,-1,-1):
    ans=ans+s[res[j]]
print(ans)

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

mylist = []

flag = True
while (flag):
    sho = N // 26
    amari = N % 26
    kurisagari = False
    if amari == 0 :
        mylist.append(26)
        kurisagari = True
    else:
        mylist.append(amari)

    if sho < 27:
        flag = False
        if kurisagari:
            mylist.append(sho - 1)
        else:
            mylist.append(sho)
    else:
        if kurisagari:
            N = sho - 1
        else:
            N = sho


num2alpha = lambda c: chr(c+96)

alphabet_list = [num2alpha(i) for i in mylist]


print(''.join(alphabet_list[::-1]).strip("`"))

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

r=[]
r.append(N%26)
x=N//26

if N%26==0:
  x=x-1
while x > 0:
  t=x%26
  r.append(t)
  x=x//26
  if t==0:
    x=x-1
  
A=["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"]

X = A[r[0]]
for i in range(len(r)-1):
    X = X + A[r[i+1]]

print(X[::-1])

Solution (Python):
i = int(input())
mozi = ""
while i>26:
    q, mod = divmod(i, 26)
    if mod == 0:
        q = q-1 
        mod = 26
    mozi = mozi + chr(mod+96)
    i = q
if i == 0:
    i = 26
mozi = mozi + chr(i+96)
kotae = mozi[::-1]
print(kotae)

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

Solution (Python):
import sys

alpha = 'abcdefghijklmnopqrstuvwxyz'

n = int(input())

i = 0
idx = n
if n > 26:
    while n > 0:
        idx = n
        i += 1
        n = n - 26**i
        

else:
    print(alpha[n-1])
    sys.exit()



def getstr(i, idx):

    if i == 0:
        return ""
    elif i == 1:
        return alpha[idx-1]
    else:
        
        t = 26**i

        
        b = int(26 * idx / t)

        bb = 0
        tmp = idx
        while tmp > 0:
            tmp -= int(t/26)
            bb += 1

        b = bb - 1
        idx -= b * int(t/26) 
        i -= 1
        
        return alpha[b] + getstr(i, idx)

print(getstr(i,idx))

Solution (Python):
import sys

from typing import List


def _10_to_26(number: int) -> List[str]:
    if number // 26:
        division = number // 26
        remain = number % 26

        if remain is 0:
            if division == 1:
                return ['z']

            return _10_to_26(number // 26 - 1) + ['z']

        _ = _10_to_26(number // 26)
        _.append(
            to_char(remain)
        )
        return _
    return [
        to_char(number % 26)
    ]


def to_char(num: int) -> str:
    return chr(ord('a') - 1 + num)


def main() -> None:
    N = int(input())
    print(''.join(_10_to_26(N)))


if __name__ == '__main__':
    sys.setrecursionlimit(100000)
    main()

Solution (Python):
K1 = 1
K2 = 27
K3 = 703
K4 = 18279
K5 = 475255
alpha = "abcdefghijklmnopqrstuvwxyz"

n = int(input())

a = ""

def func(n,k):
	global a
	a=alpha[n%26]+a
	if(k>1):
		func(n//26,k-1)

sum = 0
for i in range(1,15):
	sumb = sum
	sum += 26**i
	if(sum >= n):
		
		func((n-sumb-1),i)
		break
print(a)

Solution (Python):
import bisect













n = int(input())
 
tmp = 0
li1 = []
li2 = []
 
alp = [chr(i) for i in range(97, 97+26)]
 
for i in range(200):
    tmp += 26**i
    li1.append(tmp)
    if tmp > 10**16:
        break
 
keta = bisect.bisect_right(li1,n)
 
m = n-li1[keta-1]
 
for i in range(200):
    a = m//26
    b = m%26
    li2.append(chr(97+b))
    if a==0:
        break
    if a<26:
        li2.append(chr(97+a))
        break
    m -= b
    m = m//26
 
li2.reverse()
l = len(li2)
 
for i in range(keta):
    if l < keta:
        li2.insert(0,'a')
        l+=1
    else:
        break
 
print(*li2, sep='')

Solution (Python):
n = int(input())
a = [0] * 12
for i in range(11,0,-1):
    m = n // 26 ** i
    a[i] = m
    n -= m * (26 ** i)
a[0] = n
for i in range(11, - 1, - 1):
    if a[i] == 0:
        a.pop(i)
    else:
        break
b = "abcdefghijklmnopqrstuvwxyz"
c = []
for i in range(len(a)):
    if i == len(a) - 1 and a[i] == 0:
        break
    elif i != len(a) - 1 and a[i] == 0:
        a[i] = 26
        a[i + 1] -= 1
    elif i != len(a) - 1 and a[i] == - 1:
        a[i] = 25
        a[i + 1] -= 1
    c.append(b[a[i] - 1])
c.reverse()
print(*c, sep="")

Solution (Python):
def resolve():
    n = int(input())
    log26 = []
    while n > 0:
        log26.append(n%26)
        n //= 26

    ans = []
    for i in range(len(log26)-1):
        if log26[i] > 0:
            ans.append(log26[i])
        else:
            ans.append(log26[i]+26)
            log26[i+1] -= 1
    if log26[-1]!=0:
        ans.append(log26[-1])
    ans1 = []
    for i in range(len(ans)):
        ans1.append(chr(ans[i]+96))
    print("".join(ans1[::-1]))

resolve()

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


if  n >= ((26 ** 12 - 1) / (26 - 1)):
     n = n - ((26 ** 12 - 1) // (26 - 1))
     l = n // (26 ** 11)
     n = n % (26 ** 11)
     k = n // (26 ** 10)
     n = n % (26 ** 10)
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[l] + a[k] + a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]      

elif n >= ((26 ** 11 - 1) / (26 - 1)):
     n = n - ((26 ** 11 - 1) // (26 - 1)) 
     k = n // (26 ** 10)
     n = n % (26 ** 10)
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[k] + a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]      
     
elif n >= ((26 ** 10 - 1) / (26 - 1)):
     n = n - ((26 ** 10 - 1) // (26 - 1))
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]      
     
elif n >= ((26 ** 9 - 1) / (26 - 1)):
     n = n - ((26 ** 9- 1) // (26 - 1)) 
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]      
     
elif n >= ((26 ** 8 - 1) / (26 - 1)):
     n = n - ((26 ** 8 - 1) // (26 - 1)) 
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]      
     
elif n >= ((26 ** 7 - 1) / (26 - 1)):
     n = n - ((26 ** 7 - 1) // (26 - 1))
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]

elif n >= ((26 ** 6 - 1) / (26 - 1)):
     n = n - ((26 ** 6 - 1) // (26 - 1))
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[f] + a[e] + a[d] + a[c] + a[b] + a[aa]
     
elif n >= ((26 ** 5 - 1) / (26 - 1)):
     n = n - ((26 ** 5 - 1) // (26 - 1))
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[e] + a[d] + a[c] + a[b] + a[aa]
     
elif n >= ((26 ** 4 - 1) / (26 - 1)):
     n = n - ((26 ** 4 - 1) // (26 - 1)) 
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[d] + a[c] + a[b] + a[aa]
     
elif n >= ((26 ** 3- 1) / (26 - 1)):
     n = n - ((26 ** 3 - 1) // (26 - 1)) 
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[c] + a[b] + a[aa]
     
elif n >= ((26 ** 2 - 1) / (26 - 1)):
     n = n - ((26 ** 2 - 1) // (26 - 1)) 
     b = n // 26
     aa = n % 26
     ans = a[b] + a[aa]
     
else:
    ans = a[n-1]
    
print(ans)

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

def h(n):
    if int(n/26):
        if n % 26 == 0:
            return h(int(n/26) - 1) + 'z'
        else:
            return h(int(n/26)) + chr(96 + (n % 26))
    else:
        if n > 0:
            return chr(96 + n)
        else:
            return ''

print(h(n))

Solution (Python):
N=int(input())
a_l=""
i=1
while i:
    if N<26:
        i=0
        l=chr(97+N-1)
    else:
        m = N % 26
        N=N//26
        if m==0:
            l="z"
            if N==1:
                l="z"
                i=0
            else:
                N=N-1
        else:
            l=chr(97+m-1)
    a_l=l+a_l
print(a_l)

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

N -= 1
tmp = []
while N > -1:
    tmp.append(N % 26)
    N //= 26
    N -= 1
    if N == 0:
        tmp.append(0)
        break

res = ""
for t in tmp:
    res += chr(ord('a') + t)

print(res[::-1])

Solution (Python):
N = int(input())
l = []
while N:
    N -= 1
    l.append(chr(97+(N % 26)))
    N //= 26

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

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect


input = sys.stdin.readline




n = int(input()) - 1
n_ = n

cnt = 0
val = 0
while True:
    if n >= val:
        cnt += 1
        val += 26 ** cnt
        
    else:
        break

keta = cnt

cnt -= 1

if cnt > 0:
    for c in range(cnt):
        n_ -= 26**(c+1)
        
n = n_


ans = []
cnt = 0
while True:
    if (int(n / 26)):
        ans.append(chr(ord('a') + (n % 26)))
        n = n // 26
        cnt += 1
    else:
        ans.append(chr(ord('a') + (n % 26)))
        break



diff = keta - len(ans)

ans = ans + ['a'] * diff

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

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

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

n = int(sys.stdin.read())
n -= 1
s = 'abcdefghijklmnopqrstuvwxyz'
write = sys.stdout.write
a = []
append = a.append
while n >= 26:
  n, v = divmod(n, 26)
  n -= 1
  append(s[v])
append(s[n])
a.reverse()
print(''.join(a))