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 sys

al = "abcdefghijklmnopqrstuvwxyz"

def solve(N: int):
    i = 1
    n = ""
    while(N>0):
        m = N % 26 -1
        n = al[m] + n
        N = N // 26 - (m==-1)*1

    print(n)

    

    return



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

if __name__ == '__main__':
    main()

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def main():
    N = int(input())
    p = []
    a = N

    while a > 0:
        m = (a-1) % 26
        p.append(m)
        a = (a-1)//26

    
    
    print("".join([chr(ord('a')+n) for n in reversed(p)]))

    return


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
n+=-1
lentharray=(26,702,18278,475254,12356630,321272406,8353082582,217180147158,5646683826134,146813779479510,3817158266467286)
i0=0
i1=0
s="abcdefghijklmnopqrstuvwxyz"
for i in lentharray:
  i0+=1
  if n < i:
    break
  i1=i
i2=n-i1
r=[]
for j in range(i0):
  i3=i2%26
  r.append(s[i3])
  i2=i2//26
print("".join(reversed(r)))

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

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)

N = ini()


def solve():
    k = 26
    a = k
    p = k
    l = 1
    while a < N:
        p *= 26
        a += p
        l += 1
    b = 1
    x = N - 1
    name = [None] * l
    for i in range(l):
        c = x % 26
        name[l - 1 - i] = chr(ord("a") + c)
        x //= 26
        x -= 1
    return "".join(name)


print(solve())

Solution (Python):
def main():
    N = int(input())
    ANS = ""
    while N > 26:
        a = N % 26
        b= N // 26
        if a == 0:
            a = 26
            b -= 1
        ANS = str(chr(96 + a)) + ANS
        N = b
    ANS = str(chr(96 + N)) + ANS
    print(ANS)
    
if __name__ == '__main__':
    main()

Solution (Python):
import string
def resolve():
    N = int(input())-1
    lst = []
    while True:
        lst.append(N%26)
        N //= 26
        N-=1
        if N == -1:
            break
    lst.reverse()

    
    st = [string.ascii_lowercase[i] for i in lst]
    print("".join(st))
resolve()

Solution (Python):
n = int(input())
m = n
u = []
while(m != 0):
    u.append(m % 26)
    m = m // 26
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(u)-1):
    if(u[i] < 1):
        u[i] += 26
        u[i+1] -= 1
u.reverse()
ans = ''
for ss in u:
    ans += s[ss-1:ss]
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(str.lower(ans))

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n):
    res = [None] * n
    for i in range(n):
        res[i] = II()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI()
    return res
def FR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LFR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR_(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI_()
    return res
def SR(n):
    res = [None] * n
    for i in range(n):
        res[i] = S()
    return res
def LSR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LS()
    return res
mod = 1000000007
inf = float('INF')


def solve():
    n = II()
    ans = []
    while n:
        x = (n-1) % 26
        n = (n-1) // 26
        ans.append(chr(x + ord("a")))
    print("".join(ans[::-1]))
    return



if __name__ == '__main__':
    solve()

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

k = []

while n > 0:
    y = n % 26
    k.append(l[y])
    n -= 1
    n //= 26
print(''.join(reversed(k)))

Solution (Python):
MOD=10**9+1
n=int(input())
ans=''
while n:
    ans=chr(ord('a')+(n+25)%26)+ans
    n=(n-1)//26
print(ans)

Solution (Python):
n = int(input())
a = ord("a")
ansl = []
while n != 0:
	n -= 1
	k = n % 26
	ansl.append(chr(a+k))
	n //= 26
print("".join(ansl[::-1]))

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

while(n > 0):
    l.append((n - 1) % 26)
    n = int((n - 1) / 26)

l.reverse()

ans = []
for i in l:
    ans.append(chr(i + ord('a')))
    
print(''.join(ans))

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

s = ""
while n>0:
  rem = n%26
  if rem == 0:
    n = n - 1
    rem = 26
  s += chr(rem+96)
  n = n//26
  
print(s[::-1])

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

res = ""
while N != 0:
  ch = N % 26
  if ch==0:
    res += alphas[-1]
    N = N//26
    N -= 1
  else:
    res += alphas[ch-1]
    N = N//26

print(res[::-1])

Solution (Python):
N=int(input())
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"]
S=""
while N>0:
  Q=N%26
  if Q==0:
    N=N//26-1
  else:
    N=N//26
  S+=alp[Q-1]
print(S[::-1])

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


BASE_CHR = 96


result = ""

while True:
    temp = N % 26
    flag = False
    if temp == 0:
        result += "z"
        flag = True
    else:
        result += chr(BASE_CHR+temp)

    N = N // 26

    if flag:
        N -= 1

    if N == 0 :
        break

print(result[::-1])

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

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

print(num2alpha(N))

Solution (Python):
n = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'

for t in range(1, 30):
    if n > 26 ** t:
        n -= 26 ** t
    
    else:
        n -= 1
        ans = [0] * t
        for i in range(t):
            ans[i] = n % 26
            n //= 26

        ans = ans[::-1]
        s = ''
        for i in range(t):
            s += alp[ans[i]]

        print(s)
        break

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


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

x = []

m = n
while True:
    b = m % 26
    if b == 0:
        b = 26
        a = m // 26 - 1
    else:
        a = m // 26

    x.append(alphabets[b - 1])

    if a < 1:
        break

    m = a

print(''.join(reversed(x)))

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=1
    alp='abcdefghijklmnopqrstuvwxyz'
    for i in range(1,16):
        temp=n-26**i
        
        if temp<=0:
            n-=1
            break
        else:
            n=temp
            ct+=1
    
    
    name=['a']*ct
    n_t=[]
    
    while n!=0:
        a=n%26
        n_t.insert(0,alp[a])
        n=n//26
    l=len(n_t)
    
    
    
    ans=name[0:ct-l]+n_t
    
    print(*ans,sep='')
        
if __name__ == '__main__':
    do()

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

ans = ["" for _ in range(11)]
count = 0
while N > 0:

    remainder = N % 26
    if remainder ==0:
        remainder = 26
    ans[count] = chr(remainder + 96)
    N = (N-remainder)//26
    count += 1
print("".join(list(reversed(ans))))

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

ans = num2alpha(N)
print(ans.lower())

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())
alphas = [ chr(i) for i in range(ord("a"), ord("z")+1)]

res = ""
while N != 0:
  ch = N % 26
  if ch==0:
    res += alphas[-1]
    N = N//26
    N -= 1
  else:
    res += alphas[ch-1]
    N = N//26

print(res[::-1])

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

n = n - 1

root = 26
p = 1


while n >= root:
	n -= root
	root *= 26
	p += 1


res = ['a'] * p

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

print(''.join(res))

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

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

    print(ans[::-1])

if __name__ == "__main__":
    main()

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

print(num2alpha(n).lower())

Solution (Python):
def func(n):
    if n<=26:
        return chr(n+96)
    if n%26==0:
        return func(n//26-1)+'z'
    return func(n//26)+chr(n%26+96)


n=int(input())
print(func(n))

Solution (Python):
alphabet = ["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())

sub = 26
count = 1
while True:
  if n <= sub:
    break
  n -= sub
  sub *= 26
  count += 1

ans = []
n -= 1
for i in range(count):
  ans.append(alphabet[n%26])
  n //= 26
ans.reverse()
print("".join(ans))

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

niroku=[]
siji=[1]
for i in range(20):
    siji.append(siji[-1]*26)
siji[0]=0
keta=0
for i in range(20):
    if(n>siji[i]):
        n-=siji[i]
        keta=i+1
n-=1


for i in range(keta):
    niroku.append(n%26)
    n//=26


ans=""
for ni in niroku:
    ans=chr(97+ni)+ans
print(ans)

Solution (Python):
n = int(input())
al=["z"]+[chr(ord('a') + i) for i in range(25)]
result = ""
while n>0:
    if n%26 !=0:
        result = al[n%26]+result
        n //= 26
    else:
        result = al[n%26]+result
        n //= 26
        n -= 1
print(result)

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())
dict={}
s='zabcdefghijklmnopqrstuvwxy'
for i in range(len(s)):
    dict[i]=s[i]
cnt=0
ans=""
while True:
    tmp=n%26
    ans=dict[tmp]+ans
    n//=26
    if tmp==0:
        n-=1
    if n<=0 :
        break
print(ans)

Solution (Python):
def digit(x):
    div = 26
    digit = 0
    while x>0:
        x -= div
        digit += 1
        div *= 26
    return digit, x + div//26

n = int(input())

keta, rem = digit(n)
div = 26**(keta-1)
ans = ""
for i in range(keta):
    a = rem // div
    b = rem % div
    
    if b==0:
        a -= 1
        b += div
    ans += chr(97+a)
    
    rem = b
    div //= 26
    
print(ans)

Solution (Python):
a=1000000000000001
n=int(input())
ans=""
tmp=[]
while n>=1:
  tmp.append((n-1)%26+1)
  n=(n-1)//26
for i in range(len(tmp)):
  ans=chr(ord('a')+tmp[i]-1)+ans
print(ans)

Solution (Python):
n = int(raw_input())
def f(n):
	r = []
	while(n):
		r.append(chr(ord('a') + (n-1)%26))
		n -=1
		n /= 26


	return ''.join(r[::-1])


print f(n)

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


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


main()

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

al = 'abcdefghijklmnopqrstuvwxyz'

def c_a(d, cs):
  nd = d // 26
  cd = d % 26
  if nd >= 26:
    cs = c_a(nd - 1, cs) + al[cd]
  elif nd == 0:
    cs = al[cd]
  else:
    cs = al[nd - 1] + al[cd]
  return cs

print(c_a(n, ''))

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy



from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n = inp()
    ans = []
    flag = 0
    n -= 1
    while True:
        x = n%26
        n //= 26
        ans.append(chr(x+97))
        if n == 0:
            break
        n -= 1
    ans.reverse()
    print(''.join(ans))
    
if __name__ == "__main__":
    main()

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









N = int(readline())

anum = ord("a")
def num_to_alpha(num):
  return chr(anum + num - 1)

ans = ""
while N:
  num = N % 26
  if num != 0:
    ans += num_to_alpha(num)
  else:
    ans += "z"
    N -= 1
  N //= 26
  
print(ans[::-1])

Solution (Python):
m = 1000000000000001

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())
c = 1
alphabet = [chr(ord('a') + i) for i in range(26)]
while n > 26**c:
    n -= 26**c
    c += 1
n -= 1

arg26 = []
n_dumy = n
while n_dumy>0:
    arg26.append(n_dumy%26)
    n_dumy = n_dumy//26

anslist = [alphabet[i] for i in arg26]
anslist.reverse()
if len(anslist) < c:
    anslist = [alphabet[0]]*(c - len(anslist)) + anslist
ans = ''.join(anslist)
print(ans)

Solution (Python):




def input_int():
    return int(input())



def int1(x):
    return int(x) - 1



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



def input_to_int_tuple():
    return tuple(map(int, input().split()))



def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


ascii_lowercase = 'zabcdefghijklmnopqrstuvwxy'
import math
def main():
    n = input_int()

    kazu = len(ascii_lowercase)

    val = []
    temp = n
    while temp > kazu:
        amari = temp % kazu
        val.append(amari)
        syo = math.floor(temp / kazu)
        if amari == 0:
            temp = syo - 1
        else:
            temp = syo

    val.append(temp % kazu)

    ans = ""
    for v in val[::-1]:
        ans += ascii_lowercase[v]

    return ans


if __name__ == "__main__":
    print(main())

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

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

  

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

Solution (Python):
N=int(input())
N=N-1
X=["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 n in range(10**7):
	ans=[X[N%26]]+ans
	if N<26:break
	N=(N)//26-1
print("".join(ans))

Solution (Python):

n = int(input())

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












print(num2alpha(n))

Solution (Python):
import math
import itertools
import collections
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7


n = IN()

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

Solution (Python):
n=int(input())
def defs(b):
	if b<=26:
		return chr(64+b)
	elif b%26==0:
		return defs(b//26-1)+chr(90)
	else:
		return defs(b//26)+chr(64+b%26)

a=defs(n).lower()
print(a)

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

Solution (Python):
n=int(input())
a=[]
t=0
while n>0:
    b=n%26
    if b==0:
        b=26
        t=1
    c=lambda b:chr(b+64)
    a.append(c(b))
    n//=26
    if t==1:
        n-=1
        t=0
d=len(a)
e=[]
for i in range(d):
    e.append(a[-1-i])
ans=''.join(e)
ans=ans.lower()
print(ans)

Solution (Python):
def main():
    n = int(input())
    al = [chr(i) for i in range(97, 97 + 26)]
    name = []
    while True:
        n, mod = divmod(n-1, 26)
        name.append(al[mod])
        if n <= 0:
            break
    print("".join(name[::-1]))


if __name__ == "__main__":
    main()

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

import math

ALPHABET = ["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"]
result = []

def alphabet_decimal(v):
    quotient = math.floor(v / len(ALPHABET))
    surplus = v % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < v:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

print(alphabet_decimal(N))

Solution (Python):
N = int(input())-1
l = len(str(N))

ans = ''

if N == 0:
    print('a')
    exit(0)

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

print(ans)

Solution (Python):



from math import *
from copy import *                    
from heapq import *                    
from string import *                
from random import *                
from bisect import *                
from sys import stdin                
from sys import maxsize                
from operator import *                
from itertools import *                
from decimal import Decimal         
from collections import Counter        
from collections import defaultdict 

'''

'''

def solve(n):
    l = []
    i = 1
    while(26**i < 1000000000000001):
        l.append(26**i)
        i += 1
    
    ans = ''
    i = len(l) - 1
    while(n and i >= 0):
        q = n // 26
        r = n % 26
        if(r):
            ans += chr(96+r)
            n //= 26
        else:
            ans += 'z'
            n //= 26
            n -= 1
    return ans[::-1]

    

N = int(stdin.readline())
ans = solve(N)
print(ans)

Solution (Python):
n = int(input())
s = [pow(26, i) for i in range(20)]
s[0] = 0
for i in range(20-1):
    s[i+1] += s[i]

for i in range(1,20):
    if n > s[i]:
        continue
    else:
        n = n - s[i-1] - 1
        ans = ''
        for j in range(1,i+1):
            idx = n // pow(26, i-j)
            ans += chr(0x61 + idx)
            n -= idx * pow(26, i-j)
        print(ans)
        break

Solution (Python):
def printString(n): 
    string = ["0"] * 10000
    i = 0
  
    while n > 0: 
        rem = n % 26
        if rem == 0: 
            string[i] = 'Z'
            i += 1
            n = int(n / 26) - 1
        else: 
            string[i] = chr((rem - 1) + ord('A')) 
            i += 1
            n = int(n / 26)
    string[i] = '0'
    string = string[::-1] 
    ans = "".join(string) 
    for i in range(10000):
        if ans[i]!="0":
            break
    print(ans[i:].lower())
    
n=int(input())
printString(n)

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

alphabet = ['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 = ''
while N != 0:
    
    name += alphabet[(N-1) % 26]
    N = (N-1) // 26
print(name[::-1])

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


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


print(num2alpha(N))

Solution (Python):

N = int(input())

alphabet = 'abcdefghijklmnopqrstuvwxyz'

ans = []





while N > 0:
    if(N > 26):
        ans.append(N % 26)
        if(N % 26 == 0):
            N -= 26
        else:
            N -= N % 26
        N = N//26
        
    elif(N == 26):
        ans.append(0)
        N = 0
    else:
        ans.append(N)
        N -= N



ans = ans[::-1]


ret = []
for i in range(len(ans)):
    ret.append(alphabet[ans[i]-1])

print(''.join(ret))


'''
for i in range(12, 0, -1):
    
    if(N // 26**i > 0)



if(N // 26**1 > 0):
    ans.append(alphabet[N//26**1 - 1])
    N -= 26**1 * (N//26**1)
ans.append(alphabet[N-1])
'''

Solution (Python):
N, res = int(input()), ""
while N > 0:
     N, R = divmod(N-1, 26)
     res = chr( 65+ R) + res
print(res.lower())

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

moji_num = {1: 26}
for i in range(2, 100):
    moji_num[i] = moji_num[i-1] * 26


ac = {0: 0, 1: 26}
for i in range(1, 100):
    if ac[i-1] >= n:
        break
    ac[i] = ac[i-1] + moji_num[i]

mojisuu = i-1
nanmojime = n - ac[i-2] - 1


arr = []
for keta in range(mojisuu):
    sisuu = mojisuu - keta - 1
    
    arr.append(nanmojime // 26**sisuu)
    nanmojime %= 26 ** sisuu


mojiretu = []
for num in arr:
    mojiretu.append(chr(97 + num))

print(*mojiretu, sep="")

Solution (Python):
import math



n=int(input())
s=''
while n>0:
	x=n//26
	d=n-x*26
	if d==0:
		s+='z'
		n=(n-26)//26
		continue
	else:
		s+=chr(96+int(d))
	if n%26==0 and x==1:
		break
	n=x
print(s[::-1])

Solution (Python):
n=int(input())
l=[chr(ord('a') + i) for i in range(26)]
ans=''
while n:
  a = n%26
  ans+=l[a-1]
  if n%26==0:
    n//=26
    n-=1
  else:
    n//=26
    ans = list(ans)
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(num2alpha(N).lower())

Solution (Python):

n=int(input())

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



ans=[]

for j in range(i):
    cnt=i-j-1
    
    ans.append(n//(26**cnt))
    n=n-(n//(26**cnt))*(26**cnt)

result=""
for item in ans:
    result+=(chr(97 + item))

print(result)

Solution (Python):


k=int(input())

from functools import lru_cache

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

print(num2alpha(k).lower())

Solution (Python):
import string

N = int(input())
d1, d2 = 0, 26
n = 1
while d2 < N:
    n += 1
    d1 = d2
    d2 += 26 ** n
m = N - d1 - 1
xs = [None] * n
for i in range(n):
    xs[-1 - i] = string.ascii_lowercase[m % 26]
    m //= 26
print(''.join(xs))

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

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())
ans = ""
al = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
while(True):
  if N <= 26:
    ans = al[N-1] + ans
    break
  tmp = N%26    
  ans = al[tmp-1] + ans
  N = N//26
  if tmp == 0:
    N -= 1
print(ans)

Solution (Python):
alphabet = {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"}
N = int(input())
name = ""
while N != 0:
     index= int(N%26)
     if index == 0:
         name += alphabet[25]
     else:
         name += alphabet[index-1]
     N = int((N-1)/26)
print(name[::-1])

Solution (Python):

import math
N = int(input())
ans=[]
while N > 0:
    ans.append(N%26)
    N = math.floor((N-1)/26)
alphabet = 'abcdefghijklmnopqrstuvwxyz'
ans = reversed(ans)
for i in ans:
    print(alphabet[i-1],end="")

Solution (Python):


import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N = int(input())
    s = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    a = N-1
    x = 26
    i = 1
    while True:
        if a < x:
            break
        a -= x
        x *= 26
        i += 1

    while a:
        a, b = divmod(a, 26)
        ans = s[b] + ans


    print(s[0]*(i-len(ans)) + ans)

if __name__ == "__main__":
    resolve()

Solution (Python):
n=int(input())
res=""
while n!=0:
    mod=n%26
    n=n//26
    if mod==0:
        mod=26
        n-=1
    res+=chr(97+mod-1)
print(res[::-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(num2alpha(N).lower())

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

def get_info(N):
    d = 1
    while N > pow(26, d):
        N -= pow(26, d)
        d += 1
    return d, N

def convert(x, n):
    if x // n == 0:
        return [x % n]
    return convert(x // n, n) + [x % n]

N = int(input().strip())
digit, n = get_info(N)
name = [string.ascii_lowercase[i] for i in convert(n-1, 26)]
if len(name) < digit:
    name = ["a" for _ in range(digit-len(name))] + name

print("".join(name))

Solution (Python):
num=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(num).lower())

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):
import math
from decimal import Decimal

N = int(input())

res = ""

alp = "0abcdefghijklmnopqrstuvwxyz"

while N > 0:
    
    if N > 26:
        
        NN = N//26
        
        
        m = N - NN*26
        N = N//26
        
        if m==0:
            m=26
            N = N-1
        
        res = alp[m] + res
    else:
        
        
        res = alp[N] + res
        N = 0

print(res)

Solution (Python):
N = int(input())
l = 'abcdefghijklmnopqrstuvwxyz'
name = ''
while N > 0:
    t1 = N // 26
    t2 = N % 26
    if t2 == 0:
        t1 -= 1
    name = l[t2-1] + name
    N = t1
print(name)

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

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

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

N-=1

dit = [0 for _ in range(100)]
i = 0
while True:
  dit[i] = N % 26
  N = N // 26
  if N == 0:
    break
  else:
    N -= 1
  i+=1


name = ""
for j in range(i,-1,-1):
  name += chr(97+dit[j])
  
print(name)