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

n -= 1
ansl = ""
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
while True:
    ansl += ascii_lowercase[n % 26]
    if n <= 25:
        break
    n //= 26
    n -= 1

print(ansl[::-1])

Submission status: Accepted

Solution code:
n = int(input())
h = []
tmp = ["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:
    mod = n % 26
    h.append(mod)
    n //= 26
    if mod == 0:
        n -= 1
h.reverse()
for i in h:
    name += tmp[i - 1]
print(name)

Submission status: Accepted

Solution code:
def alf(st):
  if st == 0:
    return "a"
  if st == 1:
    return "b"
  if st == 2:
    return "c"
  if st == 3:
    return "d"
  if st == 4:
    return "e"
  if st == 5:
    return "f"
  if st == 6:
    return "g"
  if st == 7:
    return "h"
  if st == 8:
    return "i"
  if st == 9:
    return "j"
  if st == 10:
    return "k"
  if st == 11:
    return "l"
  if st == 12:
    return "m"
  if st == 13:
    return "n"
  if st == 14:
    return "o"
  if st == 15:
    return "p"
  if st == 16:
    return "q"
  if st == 17:
    return "r"
  if st == 18:
    return "s"
  if st == 19:
    return "t"
  if st == 20:
    return "u"
  if st == 21:
    return "v"
  if st == 22:
    return "w"
  if st == 23:
    return "x"
  if st == 24:
    return "y"
  if st == 25:
    return "z"
   
def cc():
  N,=list(map(int, input().split()))
  li = [0 for i in range(100)]
  NN = N
  count=1
  for i in range(1,100):
    if NN > 26 ** i:
      NN = NN - 26 ** i
    else:
      l=i
      break; 
  NN-=1
  count=0
  while True:
    li[count]=NN%26
    count+=1
    NN //=26
    if NN <26:
      li[count]=NN%26
      break    
  re=[alf(i) for i in li[:l]]
  re.reverse()
  print("".join(re))

cc()

Submission status: Accepted

Solution code:
import math
N=int(input())

a=[chr(i) for i in range(97, 97+26)]
# [chr(i) for i in range(ord('a'), ord('z')+1)]
if N>26:
    answers = []
    while N > 0:
        N-=1
        b = N % 26
        answers.append(a[b ])
        N = N // 26

    answers.reverse()
    b = ''
    for a in answers:
        b += a
    print(b)
else:
    print(a[N-1])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = ""
while n > 0:
  n, r = divmod(n, 26)
  if r == 0:
    r = 26
    n -= 1
  a += chr(r-1 + ord('a'))
print(a[::-1])

Submission status: Accepted

Solution code:
import string
n = int(input())

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N = int(input())
temp = N
ans= ""
t = 26
count = 1

while True:
  if(N<=t):
    break
  else:
    N -= t
    t=t*26
    count+=1

#N = temp

#for i in range(count):
  

for i in reversed(range(1,count)):
  ans += chr(96+(N-1)//(26**i)+1)
  #print(N,i,(N-1)//(26**i))
  N = N-(26**i)*((N-1)//(26**i))
  #print(i)

#print(N)
if(N==0):
  ans += chr(96+26)
else:
  ans += chr(96+N)

#ans += chr(96+N)
#ans += chr(96+temp%26)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
s = ''
while n>0:
    n -= 1
    i = n % 26
    s += ascii_lowercase[i]
    n = n // 26
out = s[::-1]
print(out)

Submission status: Accepted

Solution code:
import string
a=string.ascii_lowercase
N=int(input())
ans=[]
count=1
n=26
s=0
while N>n:
    count+=1
    s=n
    n+=26**count
N-=s+1
for i in range(count):
    n=N//26
    m=N%26
    ans.append(a[m])
    N=n
Ans=[]
for i in range(len(ans)):
    Ans.append(ans[len(ans)-i-1])
print("".join(Ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=''
while True:
  n-=1
  s+=chr(n%26+65)
  if n<=25:
    break
  n//=26
  n+1
s=''.join(reversed(s))
s=s.lower()
print(s)

Submission status: Accepted

Solution code:
A="abcdefghijklmnopqrstuvwxyz"
n=int(input())
i=1
while n-26**i>0:
    n-=26**i
    i+=1
name=[]
n-=1
for j in range(i):
    temp=n%26
    name.append(A[temp])
    n//=26
for k in name[::-1]: print(k,end="")

Submission status: Accepted

Solution code:
n = int(input())
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n > 0:
    n, r = divmod(n-1, 26)
    ans = a[r] + ans
print(ans)

Submission status: Accepted

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

n = int(input())

import string
from collections import deque

name_table = string.ascii_lowercase
ans = deque()


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

print(''.join(ans))

Submission status: Accepted

Solution code:
import math
import pprint
import fractions
import collections
import itertools
from decimal import *
N=int(input())
N=N-1
l=[pow(26,i) for i in range(1,20)]
x=[0]
for i in range(19):
    x.append(x[len(x)-1]+l[i])
#print(x)
le=0
for i in range(1,40):
    if x[i-1]<=N<x[i]:
        N=N-x[i-1]
        le=i
        break
l.sort(reverse=True)
ans=[]
for i in range(le-1,-1,-1):
    d=N//pow(26,i)
    N=N%pow(26,i)
    ans.append(chr(d+ord("a")))
print("".join(ans))

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori


def main():
    kazu = [0]
    for i in range(1, 14):
        kazu.append(26 ** i + kazu[i - 1])
    #    print(kazu)
    n = int(input())

    def hante(a):
        b = 0
        for i in range(len(kazu)):
            if a <= kazu[i]:
                b = i
                break
        return b

    keta = hante(n)
    ans = []
    i = keta - 1
    n -= kazu[keta - 1]+1
    ans.append(n%26+1)
    n//=26
    while i > 0:
        temp = n % 26
        ans.append(temp+1)
        n//=26

        i -= 1
    ko = list("abcdefghijklmnopqrstuvwxyz")
    ans2 = []
    for i in ans:
        ans2.append(ko[i - 1])
    ans2.reverse()
    print("".join(ans2))


if __name__ == "__main__":

    main()

Submission status: Accepted

Solution code:
n= int(input())

azlist = list('abcdefghijklmnopqrstuvwxyz')
ans = ''
for i in range(1,10000):
  n -= 1
  ans = azlist[n%26] + ans
  n = n//26
  if n ==0:
    break

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    MOD = 26
    ans = str()
    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']
    while N > 0:
        N -= 1
        ans = alpha[N % MOD] + ans
        N //= MOD
    print(ans)
        

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input()) - 1
ans = []
alp = [chr(i) for i in range(97, 97+26)]
while n >= 0:
    ans.append(alp[n % 26])
    n = (n // 26) - 1

print("".join(reversed(ans)))

Submission status: Accepted

Solution code:
import sys
import math

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

length=math.ceil(math.log((N*25)/26+1,26))

for g in range(1,length):
	N-=pow(26,g)

N-=1

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

for h in range(length-len(s)):
	s.append(0)

s.reverse()

ans="abcdefghijklmnopqrstuvwxyz"

for g in range(len(s)):
	print(ans[s[g]],end="")
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string

n = int(input())
f = []

if n > 26:
	while n:
		n -= 1
		n, r = divmod(n, 26)
		f += [r]
else:
	f += [n-1]

g = ''
s = string. ascii_lowercase
f.reverse()
for i in f:
	g += s[i]

print(g)

Submission status: Accepted

Solution code:
n=int(input())

nmax = 1000000000000001

def elc(idx):
    return( chr(ord('a') + idx ) )

k = n - 1
res =[]
while True:
    wkm = k % 26
    wks = k // 26
    res.append(elc(wkm))
    if wks == 0:
        break
    k = wks - 1

res.reverse()
print(''.join(res))

Submission status: Accepted

Solution code:
n = int(input())

def toa(n):
    return chr((ord('a')+(n)))

temp = n
digit = 1
temp-=26**digit
while temp > 0:
    digit+=1
    temp-=26**digit

k = n - sum([26**(i+1) for i in range(digit-1)])
x = k-1

ans = ''
while x>0:
    ans = toa(x%26)+ans
    x//=26

ans = 'a'*(digit-len(ans)) +ans
print(ans)

Submission status: Accepted

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


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np


def main():
	n=II()

	s="abcdefghijklmnopqrstuvwxyz"

	ans=""

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





















if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
al = [chr(ord('a') + i) for i in range(26)]
n = int(input())
s = ""
while n:
    s += al[n % 26 - 1]
    n = (n - 1) // 26
print(s[::-1])

Submission status: Accepted

Solution code:
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']
ln = []

while True:
    n -= 1
    b = n % 26
    ln.append(alphabet[b])

    if n <= 25:
        break

    a = n//26
    n = a

ln.reverse()
ln=''.join(ln)
print(ln)

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = I()

alpha = defaultdict(str)
for i in range(26):
    alpha[i] = chr(ord('a')+i)

# p桁でi+1番目に大きい
def calc(p,i):
    p -= 1
    ans = []
    while p >= 0:
        d = i//(26**p)
        ans.append(alpha[d])
        i -= (26**p)*d
        p -= 1
    return ''.join(ans)

c = 1
n = 0
while True:
    n += 26**c
    if n >= N:
        break
    else:
        c += 1

sum_ = 0
for i in range(1,c):
    sum_ += 26**i

print(calc(c,N-sum_-1))

Submission status: Accepted

Solution code:
def calc():
  n=int(input())
  arr=[]
  check='abcdefghijklmnopqrstuvwxyz'
  while n!=0:
    n-=1
    arr.append(check[n%26])
    n//=26
  arr=arr[::-1]
  print(''.join(map(str,arr)))
  
calc()

Submission status: Accepted

Solution code:
def int_to_char(num):
  return chr(num + 97)

def name(num):
  ret = []
  while num != 0:
    num -= 1
    d = num % 26 
    ret.insert(0, d)
    num = num // 26

  return ''.join(map(int_to_char, ret))

if __name__ == "__main__":
  print(name(int(input())))

Submission status: Accepted

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################
N = int(input())
ans = "" 
for i in range(10000):
    N -= 1
    tmp = N%26
    ans += chr(97+tmp)
    N //= 26
    if N <= 0:
        break
 
print(ans[::-1])

Submission status: Accepted

Solution code:
def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy > 0:
        X_dumy-=1
        out.append(X_dumy % n)
        X_dumy = int(X_dumy / n)
    return out

n = int(input())
d = {y: x for x, y in zip("abcdefghijklmnopqrstuvwxyz", range(26))}

res = []
array = Base_10_to_n(n, 26)

print("".join([d[x] for x in array[::-1]]))

Submission status: Accepted

Solution code:
n= int(input())

azlist = list('abcdefghijklmnopqrstuvwxyz')
ans = ''
for i in range(1,10000):
  n -= 1
  ans = azlist[n%26] + ans
  n = n//26
  if n ==0:
    break

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
t="abcdefghijklmnopqrstuvwxyz"
def f(n):
  if n<=26:return t[n-1]
  return f((n-1)//26)+t[(n-1)%26]
print(f(n))

Submission status: Accepted

Solution code:
N = int(input())


def base10to(n, b):
    if n // b:
        return base10to(n // b - 1, b) + ',' + str(n % b)
    return str(n % b)

res_26 = base10to(N - 1, 26)

res = []
for s in res_26.split(','):
    res.append(chr(97 + int(s)))

print(''.join(res))

Submission status: Accepted

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

while(i > 0):
    i -= 1
    ans.append(moji_list[i % 26])
    i //= 26

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

Submission status: Accepted

Solution code:
number   = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
name_tag = []

while number > 0:
  number, a = divmod(number-1, 26)
  name_tag.append(a)
  
reverse_name_tag = reversed(name_tag)
for i in reverse_name_tag:
  print(alphabet[i], end="")

Submission status: Accepted

Solution code:
import string
alphabets = "abcdefghijklmnopqrstuvwxyz"
n = 26

ans = ''
tmp = int(input())
while tmp > 0:
    tmp -= 1
    idx = tmp % n
    ans = alphabets[idx] + ans
    tmp //= n
print(ans)

Submission status: Accepted

Solution code:
import string

n = int(input())

alpha = list(string.ascii_lowercase)

result = ''

while n > 0:
    n -= 1
    digit = int(n % 26)
    n = int(n // 26)
    result = alpha[digit] + result

print(result)

Submission status: Accepted

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

def main():
    n = int(input())
    start = 0
    cnt = 0
    while 1:
        start += 26 ** cnt
        if start > n:
            start -= 26 ** cnt
            break
        cnt += 1
    ans = ''
    tmp = n - start
    for i in range(cnt):
        ans += chr(ord('a') + tmp % 26)
        tmp //= 26
    print(ans[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'

    s = ''
    while n>0:
        n -= 1
        i = n % 26
        s += ascii_lowercase[i]
        n = n // 26

    out = s[::-1]
    print(out)

main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = ""
    while n > 0:
        n -= 1
        q = n//26
        r = n%26
        ans += chr(ord("a") + r)
        n = q
    print(ans[::-1])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import itertools
#import resource
#xrange = lambda stop: iter(itertools.count().next, stop)
#sys.setrecursionlimit(1000000)
#sys.setrecursionlimit(10 ** 13)
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()


ans = []
while True:
    n -= 1
    ans.append(chr(ord("a") + n % 26))
    n //= 26
    if n <= 0:
        break
for i in range(len(ans)):
    print(ans[-i-1], end="")

Submission status: Accepted

Solution code:
#print(chr(97))
N = int(input())
lenJudgeNum = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582,
               217180147158, 5646683826134, 146813779479510, 3817158266467286]
alpLen = 0
tmp = N
for i in range(len(lenJudgeNum)):
    if N <= lenJudgeNum[i]:
        alpLen = i + 1
        break

ansStr = ''
prev = 'a'
for i in range(alpLen):
    #alpNum = N % 27
    N -= 1
    alpNum = N % 26
    ansStr = chr(alpNum + 97) + ansStr
    #alpNum = N % 26 if N % 26 != 0 else 26

    # print(alpNum)
    #print(chr(alpNum + 96))
    # print("prev")
    # print(prev)
    # print()
    '''
    cur = chr(alpNum + 96)
    if prev == 'z' and chr(alpNum + 96) == 'a':
        cur = 'z'
        ansStr = 'z' + ansStr
    else:
        cur = chr(alpNum + 96)
        ansStr = chr(alpNum + 96) + ansStr
    '''
    N = N//26
    # print(N)
    #prev = cur

print(ansStr)

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    n = II()
    ans = ''
    while n > 0:
        n -= 1
        ans += chr(ord('a')+n%26)
        n //= 26
    print(ans[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要

x = int(input())
remainder_list = []
alphabet_list = "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".split()
if x <= 26:
        remainder_0 = x
        remainder_list.append(remainder_0)
else:
        while x / 26 > 0:
                remainder = x % 26
                if remainder == 0:
                        remainder = 26
                        remainder_list.append(remainder)
                        x = x // 26 - 1
                else:
                        remainder_list.append( remainder)
                        x = x // 26

remainder_list.reverse()
ans =""
for i in remainder_list:
        ans += alphabet_list[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:
s = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())

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

n -= num
n -= 1

ans = ""
while(cnt > 0):
    a = n // pow(26,cnt-1)
    n -= (pow(26,cnt-1)*a)
    cnt -= 1
    ans = ans + s[a]
print(ans)

Submission status: Accepted

Solution code:
def main():
    suu="abcdefghijklmnopqrstuvwxyz"#26
    n=int(input())
    puts=""
    if n<27:#その数より小さい
        print(suu[n-1])
        return
    while True:
        temp=n%26
        n//=26
        puts=suu[temp-1]+puts
        if temp==0:#補正
            n-=1
        if n<27:
            puts=suu[n-1]+puts
            break
    print(puts)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import deque

N = int(input())
amari = []

if N <= 26:
    print(chr(96+N))

else:
    while True: 
        N -= 1

        am = N % 26
        N = N // 26 
        amari.append(am)
        if N == 0:
            break

    answer = deque()
    for i in amari:
        answer.appendleft(chr(97+i))

    for i in answer:
        print(i, end='')

Submission status: Accepted

Solution code:
N=int(input())
a=[chr(i) for i in range(97, 97+26)]
for i in range(1,100):
    if 26**i<N:
        N-=26**i
        continue
    ans=""
    N-=1
    for j in range(i):
        ans+=a[N%26]
        N//=26
    break
print(ans[::-1])

Submission status: Accepted

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

for i in range(1,99):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a')+n%26)
            n //= 26
        break
    else:
        n -= 26**i

print(ans[::-1])

Submission status: Accepted

Solution code:
def resolve():
    from collections import deque
    S = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())
    A = deque()
    while True:
        N -= 1
        N, a = divmod(N, 26)
        A.appendleft(a)
        if N == 0:
            break
    for a in A:
        print(S[a], end="")
    print()


resolve()

Submission status: Accepted

Solution code:
t="abcdefghijklmnopqrstuvwxyz"
n=int(input())
def f(n):
    if n<=26:
        return t[n-1]
    return f((n-1)//26)+t[n%26-1]

print(f(n))

Submission status: Accepted

Solution code:

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

    print(ans[::-1])

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
dic_items = {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'}
ans = []
while n != 0:
  n -= 1
  ans.append(n%26)
  n = n//26
for i in range(len(ans)):
  print(dic_items[ans[len(ans)-1-i]],end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abc = ['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 = []
def rec(n):
    #print(n,int(n/26),n%26,abc[n%26])
    n-=1
    ans.append(abc[n%26])
    #print(n)
    if n>=26:
        #ans.append(abc[int(n%26)-1])
        return rec(int(n/26))
        #ans.append(abc[int(n%26)])
        #print(n%26)
    else:
        pass
       #ans.append(abc[int(n)])
       #print(n%26)
N = int(input())
rec(N)
#i=N

for i in range(len(ans)-1,-1,-1):
    print(ans[i],end="")

Submission status: Accepted

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

Submission status: Accepted

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

    # s[i]=l[m//(27**(i+1)-1]
w.reverse()
print("".join(w))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
no = "abcdefghijklmnopqrstuvwxyz"

def main():
    N = int(input())
    ans = ""
    while N > 0:
        N -= 1
        ans += no[N % 26]
        N //= 26
    return ans[::-1]

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

Submission status: Accepted

Solution code:
n=int(input(''))
t=[]
l=['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=n-1
while(1):
    b=n%(26)
    t.append(b)
    n=n-b-1
    if n<=0:
        break
    n=int(n/26)
    
t.reverse()
 
s=''
for a in range(len(t)):
    s=s+l[t[a]]
 
print(s)

Submission status: Accepted

Solution code:
N = int(input())

ans = ''

while True:
    N -= 1
    N, mod = N//26, N%26
    ans += chr(ord('a') + mod)
    if N==0:
        break

print(ans[::-1])

Submission status: Accepted

Solution code:
import string


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

    alphabets = string.ascii_lowercase
    base_number = 26

    ans = ''
    while N > 0:
        N -= 1
        ans += alphabets[N % base_number]
        N = N // base_number

    print(ans[::-1])


resolve()

Submission status: Accepted

Solution code:
n = int(input())
tmp = n
ans = ""

i = 1

while n > 0:
    n -= 1
    r = n % 26
    ans += chr(ord("a") + r)

    n = n // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
import string
number   = int(input())
name_tag = []

while number > 0:
  q, a = divmod(number-1, 26)
  name_tag.append(a)
  number = q
  
reverse_name_tag = reversed(name_tag)
for i in reverse_name_tag:
  print(string.ascii_lowercase[i], end="")

Submission status: Accepted

Solution code:
n = int(input())
alh = "abcdefghijklmnopqrstuvwxyz"
ans = []

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

   
   
#print(ans)

for i in range(len(ans)-1, -1, -1):
        #print(ans[i])
    print(alh[ans[i]], end="")
print()

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:
#!/usr/bin/env python3

num2alpha = lambda c: chr(c+64)
# def num2alpha(c):
#     if c == 0:
#         return "z"
#     else:
#         return chr(c + 64)

n = int(input())

r_num = []
s = n
# r_num = [0]
while s > 0:
    new_r = s % 26
    new_s = s // 26

    if new_r == 0:
        new_s -= 1
        new_r = 26

    r_num.append(new_r)
    s = new_s


r = ""
for x in r_num[::-1]:
    r += num2alpha(x)

# print(r_num)
print(r.lower())

# print(num2alpha(0))s

Submission status: Accepted

Solution code:
N = int(input())
ans = ''
for i in range(1, 99):
	if N <= 26 ** i:
		N -= 1
		for j in range(i):
			ans += chr(ord('a') + N % 26)
			N //= 26
		break
	else:
		N -= 26 ** i
print(ans[::-1]) # reversed

Submission status: Accepted

Solution code:
n = int(input())
x = "abcdefghijklmnopqrstuvwxyz"
a = n
s = ""
while a != 0:
    if a % 26 == 0:
        s += x[a % 26 - 1]
        a = a//26 - 1
    else:
        s += x[a % 26 - 1]
        a = a//26
print(s[::-1])

Submission status: Accepted

Solution code:
N = int(input())
d = "abcdefghijklmnopqrstuvwxyz"
ans = ""
N -= 1

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

Submission status: Accepted

Solution code:
n = int(input())
t = ''
while n > 0:
    n -= 1
    t+=(chr(97 + n%26))
    n//=26

print(t[::-1])

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    N = int(input())

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


    print(res[::-1])

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    ans=''
    
    while n>0:
        n-=1
        a,b=divmod(n,26)
        n//=26
        ans+=chr(ord('a')+b)
    for i in ans[::-1]:
        print(i,end='')
    print()
        

    
resolve()

Submission status: Accepted

Solution code:
N = int(input())
i = 0
list26 = []
while (N > 0):
    list26.append(N%26)
    N = int(N/26)

for i in range(len(list26)):
    if(i != len(list26)-1):
        if(list26[i] <= 0):
            list26[i] = list26[i] + 26
            list26[i+1] = list26[i+1] - 1
    else:
        if(list26[i]==0):
            list26.pop(i)
            
list26.reverse()

ans = ""

for x in list26:
    ans += str(chr(ord('a')+x-1))
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
A=np.zeros(11,dtype=int)
for i in range(11):
  A[i]=(26**(i+1))
B=np.cumsum(A)
for i in range(11):
  if N<=B[i]:
    name=[" "]*(i+1)
    if i==0:
      N=N
    else:
      N-=B[i-1]
    for j in reversed(range(i+1)):
      if j>=1:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[(N-1)//A[j-1]]
        N-=N//A[j-1]*A[j-1]
      else:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[N-1]
    break

print(''.join(name))

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