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



Sample input:
2


Sample output:
b

Submission status: Accepted

Solution code:
N=int(input())
res=""
while(N):

    N-=1
    res=res+chr(ord("a")+int(N%26))
    N=int(N/26)
res=res[::-1]
print(res)

Submission status: Accepted

Solution code:
n = int(input())

x = n 
nums = []
ans = ''
for i in range(1, 12):
    if 26**i >= n:
        for _ in range(i):
            x -= 1
            l = x % 26
            x //=  26
            nums.append(l)
        break
    else:
        n -= 26**i
        
for _ in nums:
    ans +=(chr(ord('a') + _))
    
print(ans[::-1])

Submission status: Accepted

Solution code:
# けんちょんさんの記事見た！
# https://drken1215.hatenablog.com/entry/2020/06/21/225500
N = int(input())
res = ''

while N:
  N -= 1
  res += chr(ord('a') + N%26)
  N //= 26

print(res[::-1])  # 🍡( ´ ꒳ `🌸)さんありがとー٩(๑❛0❛๑)۶

Submission status: Accepted

Solution code:
# C
N = int(input())
i = 0
lst = []
str_map = [chr(i) for i in range(97, 97+26)]
while N > 0:
    i = (N - 1) % 26
    N = (N - 1) // 26
    lst.append(str_map[i])
print(''.join(list(reversed(lst))))

Submission status: Accepted

Solution code:
def f(n):
    a = []
    while n > 0:
        n -= 1
        a.append(chr(ord('a') + n % 26))
        n //= 26
    return a

if __name__ == "__main__":
    n = int(input())
    a = f(n)
    print(''.join(a[::-1]))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    d = 0
    ac = list(accumulate([pow(26, i+1) for i in range(15)]))
    while True:
        if ac[d] >= n:
            break
        d += 1
    # 長さ d+1 の文字列の中で何番目か？
    if d > 0:
        n -= ac[d-1]
    

    def convert_to_alpha(num):
        return chr(ord('a') + num)

    n -= 1
    # print(n)
    L = [None] * (d + 1)
    for i in range(d + 1):
        L[i] = convert_to_alpha(n % 26)
        n //= 26
    
    print(''.join(reversed(L)))

    
    



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import string

n = int(input())

l = 1
while True:
    nn = 26 ** l
    if n <= nn:
        n -= 1
        o = []
        for _ in range(l):
            c = n % 26
            o.append(string.ascii_lowercase[c])
            n = n // 26
        print(''.join(o[::-1]))
        exit(0)
    n -= nn
    l += 1

Submission status: Accepted

Solution code:
# C - One Quadrillion and One Dalmatians
def main():
    N = int(input())
    res = ""
    while N:
        N -= 1
        res += chr(97 + N % 26)
        N //= 26
    print(res[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# C - One Quadrillion and One Dalmatians
def main():
    N = int(input())
    res = ""
    int_to_abc = lambda i: chr(97 + N % 26)
    while N:
        N -= 1
        res += int_to_abc(N)
        N //= 26
    print(res[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
n -= 1

a = n
cnt = 1
while a >= 26**cnt:
    a -= 26**cnt
    cnt += 1

ans = ''
for i in range(cnt):
    ans += al[n%26]
    n //= 26
    n -= 1
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
def function(X):
    c = 0
    for t in range(1,1000):
        if X <= c + 26**t:
            return t, c
        c += 26**t

def function2(n,y):
    if y == 1:
        return chr(ord('a') + ((n-1) // (26**(y-1))))
    else:
        if (n % (26**(y-1))) == 0:
            return chr(ord('a') + ((n-1) // (26**(y-1)))) + function2((26**(y-1)),y-1)
        else:
            return chr(ord('a') + ((n-1) // (26**(y-1)))) + function2((n % (26**(y-1))),y-1)
keta, summ = function(N)
summ = N - summ
print(function2(summ,keta))

Submission status: Accepted

Solution code:
import string

n = int(input())
alphabets = string.ascii_lowercase
answer = []
while n >= 1:
    n -= 1
    answer.append(alphabets[n % 26])
    n = n//26
ans = ''.join(list(reversed(answer)))
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
d=math.floor(math.log(1+(26-1)*n,26))
p=int(n-(26**d-1)/(26-1))
t=list('a'*d)
for i in range(d):
    t[d-i-1]=chr(ord(t[d-i-1])+(p%26))
    p=p//26
print(''.join(t))

Submission status: Accepted

Solution code:
N, = map(int, input().split())
al = "zabcdefghijklmnopqrstuvwxy"
rs = []
while N:
    m = N%26
    N = -(-N//26)-1
    rs.append(al[m])
print("".join(rs[::-1]))

Submission status: Accepted

Solution code:

def main2():
    n = int(input())
    d = 0
    keta = 0
    tmp = n
    ans = ""
    while n > 0:
        n -= 1
        ans += chr(ord('a') + (n%26))
        n //= 26
    print(ans[::-1])

if __name__ == '__main__':
    main2()

Submission status: Accepted

Solution code:
import math
n=int(input())
d=math.floor(math.log(1+(26-1)*n,26))
position=int(n-(26**d-1)/(26-1))
txt=list('a' * d)
for i in range(d):
    txt[d-i-1]=chr(ord(txt[d-i-1])+(position%26))
    position=position//26
print(''.join(txt))

Submission status: Accepted

Solution code:
import math
n = int(input())
d = math.floor(math.log(1+(26-1)*n, 26))
position = int(n - (26**d - 1) / (26  - 1))
txt = list('a' * d)
for i in range(d):
    txt[d - i - 1] = chr(ord(txt[d - i - 1])+(position % 26))
    position = position // 26
print(''.join(txt))

Submission status: Accepted

Solution code:
import math

n = int(input())
base = 26

digit = math.floor(math.log(1+(base-1)*n, base))
position = int(n - (base**digit - 1) / (base  - 1))

txt = 'a' * digit

txt = list(txt)

for i in range(digit):
    txt[digit - i - 1] = chr(ord(txt[digit - i - 1])+(position % base))
    position = position // base

print(''.join(txt))

Submission status: Accepted

Solution code:
import math


def nextString(text, p):
    if text[p] != 'z':
        text[p] = chr(ord(text[p])+1)
        return text
    else:
        text[p] = 'a'
        nextString(text, p - 1)

n = int(input())
base = 26

digit = math.floor(math.log(1+(base-1)*n, base))

position = int(n - (base**digit - 1) / (base  - 1))

txt = 'a' * digit

txt = list(txt)

for i in range(digit):
    txt[digit - i - 1] = chr(ord(txt[digit - i - 1])+(position % base))
    position = position // base

print(''.join(txt))

Submission status: Accepted

Solution code:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします
res = ""

n_rem = n

while True:
    x = n_rem % 26
    # 余りが0、zの場合は、26にします
    if x == 0:
        x = 26
    res += chars[x]

    # xを引いて、26で割ります
    n_rem -= x
    n_rem //= 26

    # 0なら終了します
    if n_rem == 0:
        break

# 0桁目が先頭で、最後の桁が末尾になっているので、反転させます
print(res[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
la = ['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())
flag = 0

lm = []

while n >= 1:
    m = n % 26
    if m != 0:
        lm.insert(0, m)
        n = (n-m)//26
    else:
        lm.insert(0, 26)
        n = n//26 - 1
    flag += 1

l = []

for i in range(flag):
    l.append(la[lm[i]-1])

#print(flag)
print(''.join(l))

Submission status: Accepted

Solution code:

N = int(input())

ans = ""
while N > 0:
    N-=1                        #-1 means "a"
    ans += chr(ord('a') + N%26) #chr: Unicode to character, ord:character to Unicode
    N//=26                      #next power of 26

print(ans[::-1])                #sort reverse

Submission status: Accepted

Solution code:
n=int(input())
a,b=1,[1]
for i in [0]*12:
    a=26*a+1
    b.append(a)
c=13-sorted(b+[n],reverse=True).index(n)
a=n-b[c-1]
s=''
for i in [0]*c:
    s=chr(a%26+97)+s
    a=a//26
print(s)

Submission status: Accepted

Solution code:
abc=['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']
abc_n=[26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
S=""
n=int(input())
for i in range(0, 11):
    if (n//26)>=1:
        S+=abc[n%26]
        n=int((n-abc_n[n%26])/26)
    elif n==0:
        break
    else:
        S+=abc[n%26]
        break
        
print(S[::-1])

Submission status: Accepted

Solution code:
n=int(input())
l="zabcdefghijklmnopqrstuvwxy"
ans=""
while n>0:
    ans=l[n%26]+ans
    if n%26==0:n-=1
    n//=26
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = []
while n:
  n, r = divmod(n - 1, 26)
  ans.append(chr(ord('a') + r))
ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input())

name = []
num = 0
while n > 0:
    n-=1
    res = chr(n % 26+ord('a'))
    name.insert(0,res)
    n = n//26

print(''.join(name))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import string
def main():
    def f(n):
        if n == -1:return
        a, b = divmod(n, 26)
        ans.append(string.ascii_lowercase[b])
        f(a-1)

    N = int(input())
    ans = []
    f(N-1)
    print("".join(ans[::-1]))
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
mapping = 'zabcdefghijklmnopqrstuvwxy'
res = []
for i in range(1, 99):
    if N <= 26 ** i:
        for j in range(i):
            N, r = divmod(N, 26)
            res.append(mapping[r])
            if r:
                N += 1
        break
    else:
        N -= 26 ** i
res.reverse()
print(''.join(res))

Submission status: Accepted

Solution code:
N = int(input())
alplha = ['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']
anslist = []
for k in range(10000):
    q = N//26
    r = N%26
    if r == 0:
        r = 26
        q -= 1
    anslist.append(alplha[r-1])
    N = q
    if q ==0:
        break

anslist.reverse()
ans = ''
for k in range(len(anslist)):
    ans += anslist[k]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def f(n):
    n = n-1
    a = 'abcdefghijklmnopqrstuvwxyz'
    if n // 26 == 0:
        return a[(n%26)]
    return f(n//26) + a[(n%26)]

print(f(n))

Submission status: Accepted

Solution code:
N,a=int(input()),''
while 0<N:N-=1;a+=chr(97+N%26);N//=26
print(a[::-1])

Submission status: Accepted

Solution code:
N,a=int(input()),''
while 0<N:N-=1;a+=chr(ord('a')+N%26);N//=26
print(a[::-1])

Submission status: Accepted

Solution code:
import string

n = int(input())

imanoatai = n

length = 0
cnt = 0
while True:
    length += 1
    cnt += 26 ** length
    if n <= cnt:
        break
    imanoatai -= 26 ** length

imanoatai -= 1
buf = []
for i in list(range(length))[::-1]:
    syou = imanoatai // 26**i
    amari = imanoatai % 26**i
    buf.append(syou)
    imanoatai = amari
    
for i in range(len(buf)):
    print(string.ascii_letters[buf[i]], end='')

Submission status: Accepted

Solution code:
def answer(n):
    if n <= 26:
        return chr(n-1 + 97)
    r = n % 26 - 1
    if r == -1:
        r += 26
    return answer((n-r) // 26) + chr(r + 97)


n = int(input())
print(answer(n))

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
while N > 0:
    N-=1
    ans += chr(ord('a') + N%26)
    N//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

ans = []
while N:
    N -= 1
    ans.append(chr(ord('a') + N % 26))
    N = N // 26

print("".join(map(str, ans[::-1])))

Submission status: Accepted

Solution code:
s = int(input())
ans = ""
while (s > 0):
    s -= 1
    ans += chr((s % 26) + ord("a"))
    s //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while n>0:
    n-=1
    r = n%26
    ans += chr(97+r)
    n=n//26
print(ans[::-1])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    l = 0
    for i in range(1, 12):
        if N - 26 ** i > 0:
            N -= 26 ** i
            l = i
        else:
            break

    l += 1
    N -= 1

    if N == -1:
        N = 26**l - 1

    digi = list()
    for i in range(1, l + 1):
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    for d in digi:
        ans += alpha[d]

    print(ans[::-1])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import string
import itertools
n = int(input())
s = n
l = list(string.ascii_lowercase)
count = 1
for i in range(1, 100):
    s -= 26 ** i
    if s <= 0:
        break
    else:
        count += 1
n_list = []
answer = []
for i in reversed(range(1, count+1)):
    number = min(26, n // 26 ** (i-1))
    n -= number * 26 ** (i-1)
    n_list.append(number)
n_l = []
for i, x in  enumerate(reversed(n_list)):
    if x <= 0:
        n_l.append(x + 26)
        n_list[-(i+2)] -= 1
    else:
        n_l.append(x)
for i in reversed(n_l):
    answer.append(l[i-1])
print(''.join(answer))

Submission status: Accepted

Solution code:
N = int(input())
li = list('abcdefghijklmnopqrstuvwxyz')
ans = []
count = 0
num = 0
i = 1
while count < N:
    count += 26 ** i
    num += 1
    i += 1
for j in range(1, num):
    N -= 26 ** j
N -= 1
for j in range(num):
    div, mod = divmod(N, 26)
    ans.append(li[mod])
    N = div
ans = ans[::-1]
for a in ans:
    print(a, end='')

Submission status: Accepted

Solution code:
N = int(input())
resulter = "abcdefghijklmnopqrstuvwxyz"

ans_list = []
while True:
    N = N - 1
    mod = N % 26
    ans_list.append(resulter[mod])
    N = N // 26
    if N < 1:
        break

ans_list.reverse()
print("".join(ans_list))

Submission status: Accepted

Solution code:
N = int(input())
alphabet = [chr(i + ord('a')) for i in range(26)]

res = ""

while N > 0:
    N -= 1
    r = N % 26
    N //= 26
    res += alphabet[r]

print(res[::-1])

Submission status: Accepted

Solution code:
def dogs():
    number = int(input())
    l = list('abcdefghijklmnopqrstuvwxyz')
    dogName = []
    ans = ''

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

    dogName.reverse()

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


dogs()

Submission status: Accepted

Solution code:
import string

n = int(input())
s = string.ascii_lowercase
name = ''
while True:
    if n == 0:
        break
    n -= 1
    name += s[n % 26]
    n //= 26

print(name[::-1])

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy
 
import sys
import string
def get_int(): return int(sys.stdin.readline().strip())
def get_ints(): return map(int, sys.stdin.readline().strip().split()) 
def get_list(): return list(map(int, sys.stdin.readline().strip().split())) 
def get_string(): return sys.stdin.readline().strip()
def out(data): return sys.stdout.write(str(data))
def out_list(arr): return sys.stdout.write(' '.join(str(e) for e in arr))

MAX = 10**9
MOD = 10**9 + 7

n = get_int()
alp = " "+string.ascii_lowercase
ans = ''

while n:
  ans = alp[(n-1)%26+1] + ans
  n = (n-1) // 26
print(ans)

Submission status: Accepted

Solution code:
from sys import exit
#import copy
#import numpy as np
#from collections import deque

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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)
    #print(keta)
    
    name=naming(keta,n)

    return name



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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, ""))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()  # ignore trailing spaces

n = ni()

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

print(f(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

# str : p
alphabet = "abcdefghijklmnopqrstuvwxyz"

st = ['a'] * p

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

print(*st, sep='')

Submission status: Accepted

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

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

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
#print(cnt,keta)
n-=cnt
# cnt桁のn番目の数字
ans=['a']*keta
for i in range(keta):
  ans[-i-1]=n2a(n%26)
  n//=26
#ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
#######関数部分##############
#url http://iatlex.com/python/base_change
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())

#26進数に変換
x26 = Base_10_to_n(N, 26) 
x26_list =list(x26.split())
#x26_list.remove(" ")
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"]

#26進数⇒文字
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans[::-1])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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())))

Submission status: Accepted

Solution code:

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