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 sys import exit




n, = map(int, input().split())

tmp = n

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

ans = []
gun = 0
for l in range(1, 13):
    if gun < tmp <= gun+26 ** l:
        kou = tmp - gun-1
        for k in range(l):
            ans.append(kou % 26)
            kou = kou // 26
        break
    else:
        gun += 26 ** l


s = ""
for i in ans[::-1]:
    s += alpha[i]

print(s)

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

ans = ""
alp = "abcdefghijklmnopqrstuvwxyz"
while(1):
  i = (n-1)%26
  ans = alp[i] + ans
  n = (n-1)//26
  if(n == 0):
    break

print(ans)

Solution (Python):
def readinput():
    n=int(input())
    return n

def getKeta(n):
    m=n-1
    base=0
    keta=1
    base+=26**keta
    while(m>=base):
        keta+=1
        base+=26**keta
    return keta

def naming(keta,n):
    alph='abcdefghijklmnopqrstuvwxyz'
    geta=26*(26**(keta-1)-1)//25
    m=n-geta-1
    name=''
    for _ in range(keta):
        r=m%26
        m=m//26
        name=alph[r]+name
    return name

def main(n):
    keta=getKeta(n)
    
    
    name=naming(keta,n)

    return name



if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

Solution (Python):
nb=int(input())
s = []
while nb>0:
  nb-=1
  s.append(chr(ord("a")+nb%26))
  nb//=26
roger = "".join(s)
print(roger[::-1])

Solution (Python):
import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd
from math import log,ceil

def main():
    n=int(input())
    l=ceil((log(25*n+26)/log(26)))-1
    d=n-26*(pow(26,l)-1)//25-1
    s=''
    for i in range(int(l)):
        s=chr(97+int(d)%26)+s
        d//=26
    print(s)
    



BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)

N = int(input())


def rec(n, acc):
    if n < 26:
        return chr(n + 97) + acc
    else:
        m = n % 26
        return rec((n // 26) - 1, chr(m + 97) + acc)


print(rec(N-1, ""))

Solution (Python):
import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd
from math import log,ceil

def main():
    n=int(input())
    l=ceil((log(25*n+26)/log(26)))-1
    d=n-26*(pow(26,l)-1)//25-1
    s=''
    for i in range(int(l)):
        s=chr(97+int(d)%26)+s
        d//=26
    print(s)
    



BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


if __name__ == "__main__":
    main()

Solution (Python):
from math import log,ceil
n=int(input())
l=ceil((log(25*n+26)/log(26)))-1
d=n-26*(pow(26,l)-1)//25-1
s=''
for i in range(int(l)):
    s=chr(97+int(d)%26)+s
    d//=26
print(s)

Solution (Python):
n = int(input())
a = "abcdefghijklmnopqrstuvwxyz"
s = ""
while n > 0:
    n, m = divmod(n, 26)

    if not m:
        n -= 1

    s = a[(m - 1) % 26] + s

print(s)

Solution (Python):
import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

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

n = ni()

def f(n):
    if n==0:
        return ''
    n -= 1
    return f(n//26) + chr(97+n%26)

print(f(n))

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 = int(input())
print(num2alpha(n))

Solution (Python):
n=int(input())
s=''
while n:n-=1;s=chr(n%26+97)+s;n//=26
print(s)

Solution (Python):
N = int(input())
p = 1
cnt = 26
while (cnt < N):
    p += 1
    cnt += 26 ** p

mod = (N - cnt + 26 ** p) % 26 ** p
mod = mod - 1


alphabet = "abcdefghijklmnopqrstuvwxyz"

st = ['a'] * p

for i in reversed(list(range(p))):
    st[i] = alphabet[(mod % 26)]
    mod = mod // 26

print(*st, sep='')

Solution (Python):
N = int(input())
alpha = list('zabcdefghijklmnopqrstuvwxy')
ans = ''

while N:
  n = N % 26
  ans += alpha[n]
  N //= 26
  N -= n == 0

print(ans[::-1])

Solution (Python):
n = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
bef = [0 for _ in range(11)]
ans = ''
check = 2
count = 2

while count < 14 :
    s = (pow(26, count) - 1) // 25
    if n < s :
        check -= 1
        n -= (pow(26, check) - 1) // 25
        while n > 0 :
            if n >= pow(26, check - 1) :
                n -= pow(26, check - 1)
                bef[11 - check] += 1
            else :
                check -= 1
        break
    else :
        count += 1
        check += 1

for i in range(12-count,11) :
    ans += alp[bef[i]]
print(ans)

Solution (Python):
n=int(input())
s=''
while n:n-=1;s=chr(n%26+97)+s;n//=26
print(s)

Solution (Python):
n = int(input())
flst = [int((26 ** i - 1) / 25) for i in range(1, 14)]
for i in range(len(flst)):
  if flst[i] <= n < flst[i + 1]:
    keta = i + 1
    break
n -= int(((26 ** keta - 26) / 25) + 1)
dname = ''
for i in range(keta):
  amari = n % 26
  dname += chr(amari + 97)
  n //= 26
print(dname[::-1])

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

Solution (Python):
n=int(input())
a=[]
while n:
    a+=n%26+96,
    n//=26
for i in range(len(a)-1):
    f=a[i]<97
    a[i]+=f*26
    a[i+1]-=f
print(*map(chr,a[::-1][a[-1]<97:]),sep='')

Solution (Python):
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

current=n
mozi=''
mozi1=''

list1=[]
for i in reversed(range(count+1)) :
  c=current//26**i
  current = current % 26 ** i
  list1.append(c)

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

for  i in range(count+1) :
  mozi+=chr(list1[i]+k)
print(mozi)

Solution (Python):
n=int(input())
p=1000000000000001
n2a = lambda c: chr(c+65).lower()

cnt=0
keta=0
while cnt+pow(26,keta)<=n:
  cnt+=pow(26,keta)
  keta+=1

n-=cnt

ans=['a']*keta
for i in range(keta):
  ans[-i-1]=n2a(n%26)
  n//=26

print(''.join(ans))

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    num = int(input())
    ans = ""
    for i in range(1,100):
        if num <= 26**i:
            
            num -= 1
            for j in range(i):
                ans += chr(65 + num%26)
                num //= 26
            break
        else:
            num -= 26**i
            
    ans = ans.lower()
    print(ans[::-1])


if __name__ == "__main__":
    main()

Solution (Python):


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



import sys
input = sys.stdin.readline
N = int(input())


x26 = Base_10_to_n(N, 26) 
x26_list =list(x26.split())

int_str =["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 =""
if len(x26_list) ==1:
    ans +=int_str[int(x26_list[0])-1]
else:
    ans +=int_str[int(x26_list[0])-1]

    for i in range(1,len(x26_list)):
        a =x26_list[i]
        x =int_str[int(a)]
        ans +=x

print(ans)

Solution (Python):
n=int(input())
alpha=[chr(i) for i in range(97,97+26)]
def test(x,t):
  if x//t>0:
    return test(x//t-1,t)+alpha[x%t]
  return alpha[x%t]
print(test(n-1,26))

Solution (Python):
n = int(input())
m = n
keta = 0
for i in range(1, 12):
    m -= 26 ** i
    if m <= 0:
        keta = i
        break

alpha = "abcdefghijklmnopqrstuvwxyz"

ans = str()
for j in range(keta):
    n -= 1
    ans += alpha[n % 26]
    n //= 26

print(ans[::-1])

Solution (Python):
n=int(input())
alphabet="abcdefghijklmnopqrstuvwxyz"
ans=[]
while n>0:
    n-=1
    ans.append(alphabet[n%26])
    n=n//26
ans.reverse()
print("".join(ans))

Solution (Python):
N = int(input())
S = [chr(i) for i in range(ord("a"), ord("z")+1)]

ans = ""
while N > 0:
    N -= 1
    N, r = divmod(N, 26)
    ans = S[r] + ans

print(ans)

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

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

print(ans[::-1])

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

ans = ""
last_is_z = False
while n:
    if last_is_z:
        n -= 1
        if n == 0:
            break
    if n % 26 == 0:  
        ans += "z"
        last_is_z = True
    else:
        ans += chr(96 + n % 26)
        last_is_z = False
    n //= 26

print(ans[::-1])

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

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

if N <= 26:
    print(alp[N-1])
else:
    ans = ""
    while N:
        N -= 1
        amari = N%26
        N = N//26
        ans += alp[amari]
    print(ans[::-1])

Solution (Python):
def f(n):
    alphabets = "abcdefghijklmnopqrstuvwxyz"

    s = ""
    while n > 0:
        n, mod = divmod(n, 26)
        if mod == 0:
            s += 'z'
            n -= 1
        else:
            s += alphabets[mod - 1]
    
    return s[::-1]

print(f(int(input())))

Solution (Python):

def resolve():
    lower = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())

    ans = ""
    while N:
        N -= 1
        idx = N%26
        ans += lower[idx]
        N //= 26
    print(ans[::-1])

if __name__ == "__main__":
    resolve()

Solution (Python):
def main():
    num = int(input())
    l = list('abcdefghijklmnopqrstuvwxyz')
    name = []
    ans = ''

    while num > 0:
        num = num - 1
        name.append(l[num%26])
        num = num // 26

    name.reverse()

    for i in name:
        ans = ans + i
    print(ans)


main()

Solution (Python):
n = int(input())
def B(X, n):
    X_dumy = X
    ln = []
    while X_dumy>0:
        ln.append(int(X_dumy%n))
        X_dumy = int(X_dumy/n)
    return ln
ln = B(n, 26)
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']
q = []
for i in range(len(ln)):
    if ln[i] > 0:
        q.append(a[ln[i] - 1])
    elif ln[i] == 0:
        if i != len(ln) - 1:
            ln[i + 1] -= 1
            q.append('z')
    elif ln[i] < 0:
        q.append('y')
        ln[i + 1] -= 1
        
q.reverse()
print(''.join(q))

Solution (Python):
from copy import deepcopy
N=input()
n=deepcopy(N)
total=0
for l in range(1,12):
    n-=26**l
    if n<=0: break
    total+=26**l

N-=total+1
ans=""
for i in range(l-1,-1,-1):
    ans+=chr(N/(26**i)+97)
    N%=(26**i)
print ans

Solution (Python):


import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import bisect
from queue import PriorityQueue
import itertools
from itertools import accumulate
from copy import deepcopy
from collections import Counter
import heapq
import random
import time
import os
import sys
import datetime
from functools import lru_cache
from functools import reduce
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):
    if b:print("yes")
    else:print("no")
def Yn(b):
    if b:print("Yes")
    else:print("No")
def YN(b):
    if b:print("YES")
    else:print("NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(bbool,ret1,ret2):
    if bbool:return ret1
    else:return  ret2
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def pm(x):
    return x//abs(x)
def inputintlist(): 
    return list(map(int,input().split()))
def inputfloatlist(): 
    return list(map(float,input().split()))
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):
    return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):
    return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow






n=int(input())
ans=[]
while n:
    n-=1
    ans.append(n%26)
    n//=26
ans.reverse()
ans=map(lambda  x:alp[x],ans)
ans="".join(ans)
print(ans)

Solution (Python):
n=int(input())
a=[]
while n:
    a+=n%26,
    n//=26
a=a[::-1]
for i in range(len(a)-1,0,-1):
    if a[i]<1:
        a[i]+=26
        a[i-1]-=1
print(''.join(chr(c+96)for c in a[not a[0]:]))

Solution (Python):


import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import bisect
from queue import PriorityQueue
import itertools
from itertools import accumulate
from copy import deepcopy
from collections import Counter
import heapq
import random
import time
import os
import sys
import datetime
from functools import lru_cache
from functools import reduce
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):
    if b:print("yes")
    else:print("no")
def Yn(b):
    if b:print("Yes")
    else:print("No")
def YN(b):
    if b:print("YES")
    else:print("NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(bbool,ret1,ret2):
    if bbool:return ret1
    else:return  ret2
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def pm(x):
    return x//abs(x)
def inputintlist(): 
    return list(map(int,input().split()))
def inputfloatlist(): 
    return list(map(float,input().split()))
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):
    return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):
    return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow






n=int(input())
ans=[]
while n>0:
    n-=1
    ans.append(n%26)
    n//=26
ans.reverse()
ans=map(lambda  x:alp[x],ans)
ans="".join(ans)
print(ans)

Solution (Python):
import string
 

N = int(input())
S = string.ascii_lowercase
 
ans = ''

while N > 0:
    N, b = divmod(N - 1, 26)
    ans = S[b] + ans

print(ans)

Solution (Python):
import sys
from string import ascii_lowercase

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    ans = []
    while N:
        N, r = divmod(N - 1, 26)
        ans.append(ascii_lowercase[r])

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


if __name__ == '__main__':
    main()