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())
ans = ''
while N:
    N -= 1
    ans += chr(ord('a') + N%26)
    N //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
n -= 1
n_26 = []

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

name = map(lambda x:chr(x+97),n_26[::-1])
print(''.join(name))

Submission status: Accepted

Solution code:
n = int(input())
k = 26
p = 1
while (n > k):
	n -= k
	k *= 26
	p += 1
k = 26 ** (p - 1)
s = ""
n -= 1
while (k):
	s += chr(ord('a') + n // k)
	n %= k
	k //= 26
print(s)
# print(p, n)

Submission status: Accepted

Solution code:
N = int(input())

i = 1
T = 26
ans = ""
while True:
    if N <= T ** i:
        N -= 1
        while i > 0:
            N, r = divmod(N, T)
            ans += chr(r + ord('a'))
            i -= 1
        break
    else:
        N -= T ** i
        i += 1
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

chars = "Xabcdefghijklmnopqrstuvwxyz"
result = ""
n_1 = N

while True:
    x = n_1 % 26

    if x == 0:
        x = 26

    result += chars[x]
    n_1 -= x
    if n_1 == 0:
        break

    n_1 //= 26

print(result[::-1])

Submission status: Accepted

Solution code:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  

n_rem = n  
res = ""

while True:
    x = n_rem % 26
   
    if x == 0:
        x = 26
    res += chars[x]

    
    n_rem -= x

    
    if n_rem == 0:
        break

    n_rem //= 26


print(res[::-1])

Submission status: Accepted

Solution code:
def f(n):
  if n == 0:
    return ''
  n -= 1
  return f(n//26) + chr(ord('a')+n%26)

n = int(input())
print(f(n))

Submission status: Accepted

Solution code:
n = int(input())

tmp = 0
for ll in range(1,15):
  tmp+=26**ll
  if n <= tmp:
    break

ans = ""
for l in range(1,ll+1):
  n-=1
  ans+=chr(n%26+ord('a'))
  n //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N):
    alp = 'abcdefghijklmnopqrstuvwxyz'
    number27 = []
    cnt = 26
    digit = 1
    while N > 0:
        if N <= cnt:
            break
        else:
            N -= cnt
            cnt *= 26
            digit += 1
    ans = list('a' * digit)
    N -= 1
    tmp = -1
    while N > 0:
        N, mod = divmod(N, 26)
        ans[tmp] = alp[mod]
        tmp -= 1
    print(''.join(ans))


if __name__ == '__main__':
    # S = input()
    N = int(input())
    # N, M = map(int, input().split())
    # As = [int(i) for i in input().split()]
    # Bs = [int(i) for i in input().split()]
    solve(N)
    # for i in range(1, 100):
    #     # print(i)
    #     solve(i)

Submission status: Accepted

Solution code:
n = int(input())
lis = []
#print(n)
alf = ""

while n > 0:
    n -= 1
    mod = n % 26
    lis.insert(0,mod)
    n = n // 26
    #print(n)

for i in lis:
   alf += chr(ord("a") + i)
print(alf)

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

a = [0]

i = 0
L = 26
while True:
    if a[i] < N <= a[i] + L**(i + 1):
        break
    a.append(a[i] + L**(i + 1))
    i += 1


N -= a[i] + 1

for j in range(i, -1, -1):
    if j > 0:
        print(chr(N // L**(j) + ord('a')), end="")
    else:
        print(chr(N + ord('a')), end="")
    N = N % L**(j)

Submission status: Accepted

Solution code:
import math

n = int(input())

'''
(26**(m+1) - 26) / 25 <= n
26**(m+1) <= 25n + 26
m <= log(25n+26, 26) - 1
'''

m = int(math.log(25*n+26, 26) - 1)

d = n - (26**(m+1) - 26) // 25

alphabetTable = ['z']
alphabetTable.extend(chr(i) for i in range(97,123))


if d == 0:
  print('z' * m)

else:
  dd = []
  cnt = 0
  for i in range(1, m+2):
    cnt += 1
    amari = d % 26
    d = d//26 + 1
    if amari == 0:
      d -= 1
    dd.append(amari)
    if d <= 0:
      break
  


  alpha = [alphabetTable[dd[i]] for i in range(cnt)]
  alpha.extend(['a' * (m+1-cnt)])
  alpha.reverse()
  print(''.join(alpha))

Submission status: Accepted

Solution code:
n = int(input())

ans = ''

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    s = 'abcdefghijklmnopqrstuvwxyz'
    assert len(s) == 26
    cur = []
    while N > 0:
        amari = N % 26
        if amari == 0:
            amari += 26
        cur.append(s[amari-1])
        N -= amari
        N //= 26
    print(''.join(cur[::-1]))
main()

Submission status: Accepted

Solution code:
N = int(input())
ans = ""

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

Submission status: Accepted

Solution code:
n = int(input())

alp = 'abcdefghijklmnopqrstuvwxyz'

name = []

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

name.reverse()

print(*name,sep='')

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())

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

s = 0
for i in range(1,100):
  l = n - s
  s += 26**i
  if n <= s:
    m = i
    break #第m群l番目

name = [0] * m
div = [0] * m
rem = [0] * m
rem[-1] = l

for j in range(m):
  div[j] = ceil(rem[j-1] / (26**(m-j-1)))
  rem[j] = rem[j-1] % (26**(m-j-1))
  if rem[j] == 0:
    rem[j] == 26**(m-j-1)
  name[j] = a[div[j]-1]
    
print(''.join(name))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from itertools import chain

# form bisect import bisect_left, bisect_right, insort_left, insort_right
# from collections import Counter
# import numpy as np


def solve(N: int):
    az = "abcdefghijklmnopqrstuvwxyz"
    N -= 1
    answer = ""
    while True:
        answer = az[N % 26] + answer
        N = N // 26
        if N == 0:
            break
        N = N - 1
    return answer


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N = map(int, line.split())
    N = int(next(tokens))  # type: int
    answer = solve(N)
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import string
N = int(input())
L = string.ascii_lowercase
ans = []

while N > 0:
    s = N % 26
    N  = (N - 1) // 26
    ans.append(L[s-1])

ans.reverse()
print("".join(ans))

Submission status: Accepted

Solution code:
S = list("abcdefghijklmnopqrstuvwxyz")

N = int(input())

P = 0

for i in range(1,15):
    if P+26**i >= N:
        n = i
        break
    else:
        P += 26**i
        
X = [0]*n

NN = N - P - 1###0-indexedの26進法なので
for i in range(n):
    X[n-i-1] = S[NN % 26]
    NN //= 26

print("".join(X))

Submission status: Accepted

Solution code:
N = int(input())

alph = ['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']

seq = []

while N > 0:
    s = N % 26
    N  = (N - 1) // 26
    seq.append(s)
L = len(seq)

name = ''

for i in range(L):
    name = alph[seq[i]] + name

print(name)

Submission status: Accepted

Solution code:
N = int(input()) - 1
rst = ''
for i in range(1, 10 ** 15):
    if N >= 26 ** i:
        N -= 26 ** i
        continue
    for j in range(i):
        rst += chr(ord('a') + N % 26)
        N //= 26
    print(rst[::-1])
    break

Submission status: Accepted

Solution code:
N = int(input())
ans = ""
letter = "abcdefghijklmnopqrstuvwxyz"

while N != 0:
    N -= 1
    ans = letter[N % 26] + ans
    N = N // 26
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

digit = 0
max = 0
while True:
    if N <= max:
        break
    digit += 1
    max += 26 ** digit
under_digit = 0

for i in range(1, digit):
    under_digit += 26 ** i

order = N - under_digit - 1 #0_index
# print("order:", order)

letter = ['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']

remain = order
now = digit - 1

# print("digit:", digit)
ans = ""
# print(ans)
# counter = 0
if remain == 0:
    ans = "a" * digit
while remain != 0:
    # print("---------------")
    # counter += 1
    # print("counter", counter)
    # if counter >= 10:
    #     break

    ans = ans + letter[remain // (26 ** now)]
    remain %= 26 ** now
    now -= 1
    # print("ans:", ans, "remain:", remain, "now:", now)
    if remain == 0 and now == 0:
        ans = ans + "a"
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
letters = 'zabcdefghijklmnopqrstuvwxy'

def solve(N):
    md = N%26
    l = letters[md]
    if md==0: md=26
    if N>26:
        return solve((N-md)//26) + l
    else:
        return l

print(solve(N))

Submission status: Accepted

Solution code:
def solve(n):
    ret = []
    while n > 26:
        if n % 26 == 0:
            ret = [26] + ret
            n = (n - 26) // 26
        else:
            ret = [n % 26] + ret
            n = n // 26
    ret = [n] + ret
    return ret

n = int(input())
ans = ''.join([chr(ord('a') + i - 1) for i in solve(n)])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = []
while N:
    N -= 1
    a = N % 26
    ans.append(chr(ord('a') + a))
    N //= 26
ans.reverse()
print(''.join(ans))

Submission status: Accepted

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

for i in range(1, 100):
  if N <= 26**i:
    N = N - 1
    for j in range(i):
      ans += chr(ord('a')+ N % 26)
      N = N // 26
    break
  else:
    N = N - 26**i
    
print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

l = [1]
for i in range(1,12):
    l.append(26**i + l[i-1])
for i in range(12):
    if l[-(i+1)] > N:
        continue
    else:
        order = 12 - i
        break
a = []
for i in range(order):
    a.append(26**i)

n = N - l[order-1]
s = ""
for i in range(order):
    s += ( chr( ord("a") + (n // a[-(i+1)]) ) )
    n -= a[-(i+1)] * (n // a[-(i+1)])

print(s)

Submission status: Accepted

Solution code:
n=int(input())
k=[1]
ans=[]
c=26
wa=0
while wa+c<n:
  k.append(c)
  wa+=c
  c=c*26
n=n-1-wa
for i in k[::-1]:
  ans.append(n//i)
  n=n%i
t=''
for i in ans: 
  t+=chr(97+i)
print(t)

Submission status: Accepted

Solution code:
n = int(input())
alphabets = ['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']

res = ''
while (n > 0):
  n = n - 1
  q = n % 26
  n = n // 26
  res = res + alphabets[q]
res = res[::-1]
print(res)

Submission status: Accepted

Solution code:
#N, K = map(int, input().split( ))
#L = list(map(int, input().split( )))
N = int(input())
i = 0
ans = []
#26^{i}がNを越えるまで以下の操作を繰り返す
while N != 0:
  s = N%26
  if s == 0:
    s = 26
  N -= s
  N //= 26
  ans.append(chr(s + 96))

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

Submission status: Accepted

Solution code:
n = int(input())
str1 = ""

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

Submission status: Accepted

Solution code:
n = int(input())
k = 0
num_list = [0] * 12

for i in range(12):
    num_list[i] = 26**(i+1)
    if n <= sum(num_list[:i]):
        k = i
        break
'print(num_list)'
'''print('k=' , k)'''
diff = n - (sum(num_list[:k-1]) + 1)
'''print(diff)'''
ans = ['a']*(k)
arr = [0] * (k)

for i in range(len(ans)):
    
    arr[i] = diff // 26**(len(ans)-1-i)%26

    '''print('arr = ',i,' ', arr[i])'''
    '''print('ans = ',i,' ', ord(ans[i]))'''
    ans[i] = (chr((ord(ans[i]) + arr[i])))
    

print(''.join(ans))

Submission status: Accepted

Solution code:
n=int(input())
ans = []
while n>0:
    if n%26==0:
        ans.append("z")
    else:
        ans.append(chr(96+(n%26)))
    n=(n-1)//26
print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
from math import log

n = float(input())
a = log(n, 26)

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']
out = []
while (n):
    n-=1
    out.append(alphabet[int(n%26)])
    n //= 26
out.reverse()

print("".join(out))

Submission status: Accepted

Solution code:
#C - One Quadrillion and One Dalmatians
N = int(input())
A = []
for i in range(1,20):
    a = N%26
    if a == 0:
        N -= 26
        A.append(26)
    else:
        N -= a
        A.append(a)
    if N<=0:
        break
    N //= 26
ans = [chr(j-1+ord('a')) for j in A]
print(''.join(reversed(ans)))

Submission status: Accepted

Solution code:
def abc171c_one_quadrillion():
    n = int(input())
    s = ''
    while n > 26:
        i = 0
        total = 1
        while total <= n:
            i += 1
            total += pow(26, i)
        total -= pow(26, i)
        i -= 1

        val = min(25, (n - total) // pow(26, i))
        s += chr(64 + val + 1)
        n -= (val + 1) * pow(26, i)

    s += chr(64 + n)
    s = s.lower()
    print(s)

abc171c_one_quadrillion()

Submission status: Accepted

Solution code:
N=int(input())
lis=[chr(i) for i in range(97, 97+26)]
ans=''
while N>0:
    N-=1
    ans+=lis[N%26]
    N=N//26
print(ans[::-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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 base_10_to_n(X, n):
    if (int(X/n)):
        return base_10_to_n(int(X/n), n)+str(X % n)
    return str(X % n)
def main():
    n = int(input())
    alpha = num2alpha(n)
    print(alpha.lower())

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
ans=""
check="abcdefghijklmnopqrstuvwxyz"

while N!=0:
	N-=1
	ans+=check[N%26]
	N=N//26

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

Submission status: Accepted

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

import math
import sys
from collections import defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect
from heapq import heappop, heappush
from fractions import gcd
import copy


def next_line():
    return input()


def next_int():
    return int(input())


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


def int_ar_mul(size):
    return [int(input()) for _ in range(size)]


def str_ar(size):
    return [input() for _ in range(size)]


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


def strs():
    return input().split()


def main():
    alp = "zabcdefghijklmnopqrstuvwxy"
    n = next_int()
    str = ""
    while n > 0:
        str = alp[n % 26] + str
        if n % 26 == 0:
            n -= 26
        n //= 26
    print(str)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
from itertools import accumulate
a=[]
for i in range(12):
    a.append(26**i)
b=list(accumulate(a))

alpha=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

N=int(input())

num=0
for i in range(12):
    if N < b[i] :
        num=i
        break

M=N-b[num-1]
r=M
for i in range(num):
    q=r//26**(num-i-1)
    r=r%26**(num-i-1)
    print(alpha[q],end='')

Submission status: Accepted

Solution code:
N = int(input())

ans = ""

while N > 0:
    N -= 1
    N, digit = divmod(N, 26)
    ans += chr(ord('a') + digit)
print(ans[::-1])

Submission status: Accepted

Solution code:
def solve():
    # ref. https://drken1215.hatenablog.com/entry/2020/06/21/225500
    N = int(input())
    ans = ''
    while N > 0:
        N -= 1
        N,digit = divmod(N,26)
        ans += chr(ord('a') + digit)
    print(ans[::-1])

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
N=int(input())
n=N
listm=[]
listn=[]
l=0
while n!=0:
  m=n%26
  listm.append(m)
  n=n//26
  l+=1

for i in range(l):
  try:
    if listm[i]<=0:
      listn.append(listm[i]+26)
      listm[i+1]-=1
    else:
      listn.append(listm[i])
  except IndexError:
    listn.append(listm[i])
    l=l-1
    exit

list_ans=[]
for i in range(N):
  try:
    ans=chr(listn[i]+96)
    list_ans.append(ans)
  except IndexError:
    break

ans=''
for i in range(l):
  ans=ans+list_ans[l-i-1]

print (ans)

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())
res = ''

while True:
    amari = N % 26
    if amari == 0:
        amari = 26
    res += chr(96 + amari)
    N -= amari
    if N == 0:
        break
    N //= 26

print(res[::-1])

Submission status: Accepted

Solution code:
OFFSET = 97
def main():
    n = int(input())

    ans = []
    while True:
        n -= 1
        n,mod = divmod(n,26)
        ans.append(chr(mod+OFFSET))
        if n==0:
            break
    print(''.join(ans)[::-1])
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    ans = ''
    while N > 0:
        N -= 1
        ans += chr(ord('a') + N % 26)
        N = N // 26

    print(ans[::-1])

main()

Submission status: Accepted

Solution code:
N = int(input())
p = N
s = []
abt = "abcdefghijklmnopqrstuvwxyz"
ans = ""

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

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

print(ans)

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k() - 1
i = 1
s = 26

while n >= s:
    n -= s
    s *= 26
    i += 1

lst = []
for j in range(i):
    lst.append(n % 26)
    n //= 26

for j in lst[::-1]:
    print(chr(j + ord('a')), end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
# n-=1
r=[]
while n:
	n-=1
	r.append(chr(ord('a')+n%26))
	n//=26
print(*r[::-1],sep='')

Submission status: Accepted

Solution code:
N = int(input().strip())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

abc = 'abcdefghijklmnopqrstuvwxyz'
s = ''
while n > 0:
    n -= 1
    n, mod = divmod(n, 26)
    s += abc[mod]
print(s[::-1])

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:
loop = [int(input())-1]
print("".join(reversed([ chr(ord("a") + code) for code in [ i % 26 for i in loop if loop[-1] // 26  > 0 and (loop.append(loop[-1] // 26 - 1)) or True]])))

Submission status: Accepted

Solution code:
n=int(input())
n-=1
a='abcdefghijklmnopqrstuvwxyz'
a=list(a)
ans=''
for i in range(1,20):
    if n<26**i:
        for j in range(i):
            ans+=a[n%26]
            n//=26
        break
    else:
        n-=26**i
print(ans[::-1])

Submission status: Accepted

Solution code:
a='abcdefghijklmnopqrstuvwxyz'
N=int(input())
name=''
while N>0:
  N-=1
  name+=a[N%26]
  N//=26
print(name[::-1])

Submission status: Accepted

Solution code:
N = int(input())
ans = ['']

while N>0:
    N = N - 1
    ans.append(chr(int(N%26+1)+ord('a')-1))
    N = int(N/26)
    
ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
ans = []

num = N-1
while(True):
  if num >= 26:
    ans.append(num%26)
    num = num//26-1
  else:
    ans.append(num)
    break
answer = ""
for n in ans[::-1]:
  answer += chr(97+n)
print(answer)

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:
def f(l, n):
	ans = []
	for i in range(l):
	  ans.append(chr(n % 26 + ord('a')))
	  n//=26
	print(''.join(reversed(ans)))

n = int(input())
val = 26
adds = 0
lastval = 0
cnt = 1
while val < n:
  lastval = val
  val = (val*26)+26
  cnt+=1
f(cnt, n-lastval-1)

Submission status: Accepted

Solution code:
# One Quadrillion and One Dalmatians
from string import ascii_lowercase as alp
N = int(input())

# 27進法に直す
def f(n):
    digits = []
    while n != 0:
        n -= 1
        rem = n % 26
        digits.append(rem)
        n = n // 26
    return digits

ans = ''.join([alp[e] for e in f(N)])[::-1]
print(ans)

Submission status: Accepted

Solution code:
N = int(input()) - 1
result = ''
for i in range(1, 10 ** 15):
    if N >= 26 ** i:
        N -= 26 ** i
        continue
    for j in range(i):
        result += chr(ord('a') + N % 26)
        N //= 26
    print(result[::-1])
    break

Submission status: Accepted

Solution code:
n = int(input())

# 文字列参照用
c = "abcdefghijklmnopqrstuvwxyz"

ans = ""

while True:
    x = n % 26
    
    if x == 0:
        x = 26
    ans += c[x-1]
    
    n -= x
    
    if n == 0:
        break
        
    n //= 26
    
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

keta = 1
keta_max_list = []
keta_max_list.append(0)

keta_max_list.append(26**(keta))
while True:
    if N <= keta_max_list[keta]:
        break
    keta += 1
    keta_max_list.append(keta_max_list[keta-1] + 26**(keta))
#print(keta,keta_max_list)

keta_list = [0 for _ in range(keta+1)]

for i in range(keta, 0, -1):  # keta ～　1 桁目までループ
    for j in range(1,27):
        if (N-keta_max_list[i-1])/26**(i-1) <= j:
            keta_list[i] = j
            N -= j*26**(i-1)
            break
            
ans_list = []
for i in range(keta, 0, -1):
    ans_list.append(chr(97+keta_list[i]-1))
ans = "".join(ans_list)

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())

ans=""

while N!=0:
    N-=1
    c=N%26
    N//=26
    ans+=chr(c+97)

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
ans = ''

while n > 0:
  n -= 1
  ans += chr(97 + n % 26)
  n //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:

n = int(input())

alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]

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

print(ans[::-1])

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>0:
    tmp=(N-1)%26
    ans=chr(int(tmp)+97)+ans
    N=int((N-tmp)/26)
print(ans)

Submission status: Accepted

Solution code:
from bisect import bisect_right
import string
N=int(input())
L=[0]*13
for i in range(1,13):
    L[i]=(L[i-1]+1)*26
# print(L)

# やるべきことは26進数

def bisectsearch_right(L,a):
    i=bisect_right(L,a)
    return(i)

S=string.ascii_lowercase
l=bisectsearch_right(L,N-1)
s=['']*l
tmp=N-1-L[l-1]
# print(l,tmp)
j=l-1
while j>=0:
    s[j]=S[tmp%26]
    tmp//=26
    j-=1
print(''.join(s))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())

    n26 = 1
    keta = 0
    while n > 0:
        n26 *= 26
        n -= n26
        keta += 1
    n = n + n26 - 1
    r = []
    for i1 in range(keta):
        t1 = n % 26
        r.append(chr(t1 + 97))
        n = n // 26
    print("".join(r[::-1]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    r = []
    while n > 0:
        n -= 1
        t1 = n % 26
        r.append(chr(t1+97))
        n = n // 26
    r2 = "".join(r[::-1])
    print(r2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

t = ""
while N > 0:
    t += chr((N-1)%26 + 97)
    N = (N-1)//26

print(t[::-1])

Submission status: Accepted

Solution code:
n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
ans = ""
i = 0
# 次26**iを引いたらマイナスになるよ、というところで抜ける
while n - 26**i >= 0:
    n -= 26**i
    i += 1
# ここを抜けた時,iは桁数、nは「i桁の中でn番目」を表す

# したからk番目は、26**kで割った余り（に対応するアルファベット）
# 「上の桁で表現しきれなかった数」＝「その桁での表現」
#　これ、10進法をn進法に変換するアルゴリズムの正当性の説明を適用するとしっかりわかるわ！
for _ in range(i):
    q,r = divmod(n,26)
    n = q
    ans += alphabet[r]
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
ans = ""
i = 0
# 次26**iを引いたらマイナスになるよ、というところで抜ける
while n - 26**i >= 0:
    n -= 26**i
    i += 1
# ここを抜けた時,iは桁数、nは「i桁の中でn番目」を表す

# したからk番目は、26**kで割った余り（に対応するアルファベット）
# 「上の桁で表現しきれなかった数」＝「その桁での表現」
for _ in range(i):
    q,r = divmod(n,26)
    n = q
    ans += alphabet[r]
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
ans = ""
i = 0
while n - 26**i >= 0:
    n -= 26**i
    i += 1
# ここを抜けた時,iは桁数

for _ in range(i):
    q,r = divmod(n,26)
    n = q
    ans += alphabet[r]
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
alf = list("abcdefghijklmnopqrstuvwxyz")
ans=""
i=0
while n-26**i>=0:
  n-=26**i
  i+=1

for j in range(i):
  n,b=divmod(n,26)
  ans+=str(alf[b])
print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ascii_letters = 'abcdefghijklmnopqrstuvwxyz'
for i in range(1,15):
    if n<=26**i:
        order=i
        n-=1
        break
    n-=26**i

for i in range(order):
    print(ascii_letters[n//(26**(order-i-1))],end='')
    n%=(26**(order-i-1))
print()

Submission status: Accepted

Solution code:
N = int(input())
ans = ''
i = 1

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

    N = N // 26

print(ans)
exit()

Submission status: Accepted

Solution code:
ans=[]
N=int(input())
alf=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

while N>0:
    N,b=divmod(N-1,26)
    b=alf[b]
    ans.insert(0,b)


print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
c = []
while N > 0:
    N -= 1
    c.append(N % 26)
    N //= 26
c.reverse()
ans = "".join(chr(ord("a") + x) for x in c)
print(ans)

Submission status: Accepted

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

ans = ""
while True:
  b = n // 26
  c = n % 26
  if b == 0:
    ans = a[c] + ans
    break
  elif b == 1:
    ans = a[b - 1] + a[c] + ans
    break
  else:
    ans = a[c] + ans
    n = b - 1
    
print(ans)

Submission status: Accepted

Solution code:

def num2alpha(num):
    return chr(num+65).lower()


N = int(input()) - 1
ans = ""
while(True):
    surplus = N % 26
    N -= surplus
    num = surplus
    ans = num2alpha(num) + ans
    if N == 0:
        break
    else:
        N //= 26
        N -= 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
name_base = []
dog_name = ''
while n > 0:
  ch_mod = (n-1)%26
  n = (n-1)//26
  name_base.append(ch_mod)
for i in name_base:
  dog_name = dog_name + chr(i+97)
print(dog_name[::-1])

Submission status: Accepted

Solution code:
n = int(input())
s = ""
al = "abcdefghijklmnopqrstuvwxyz"
 
while n > 0:
  o = (n-1) % 26
  n = (n-1) // 26
  s += al[int(o)]
 
print(s[::-1])

Submission status: Accepted

Solution code:
n = int(input())
s = ""
al = "abcdefghijklmnopqrstuvwxyz"

while n > 0:
  o = (n-1) % 26
  n = (n-1) // 26
  s += al[int(o)]

print(s[::-1])

Submission status: Accepted

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

res = res[::-1]
print("".join(res))

Submission status: Accepted

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