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

p = list("zabcdefghijklmnopqrstuvwxy")


num = ""

while n > 26:
    a = p[n % 26]
    num += a
    if n % 26 == 0:
        n = n // 26 - 1
    else:
        n = n // 26

num += p[n%26]

new_num = num[::-1]
print(new_num)

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

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
st  = deque()
while n > 0:
    num = (n - 1) % 26
    n = (n - 1) // 26
    st.appendleft(chr(num + 97))
print(*st, sep = "")

Submission status: Accepted

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

while n>0:
  if n%26 == 0:
    result = "z" + result
    n=n//26-1
  else:
    result= (chr(ord("a")+n%26-1)) + result
    n=n//26
  
print(result)

Submission status: Accepted

Solution code:
N = int(input())
S = ""
Num = 0
Ans = []

for i in range(15):
  if not N:
    break
    
  r = (N-1) % 26 +1
  #print("r=", r)
  N = (N-1) // 26
  S += chr(ord("a")+r-1)
  
print(S[::-1])

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

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

Submission status: Accepted

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

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""

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

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

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

    n_rem //= 26

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

Submission status: Accepted

Solution code:
from string import ascii_lowercase

N = int(input())

d = ""
while N > 0:
    N -= 1
    c = N % 26
    N = N // 26
    d = d + ascii_lowercase[c]

print(d[::-1])

Submission status: Accepted

Solution code:
n = int(input())

ans = ''
# 制約条件は高々 26 の 10 乗なので、取り合えずインデックスを13に設定して回す
for i in range(1, 13):
    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:
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(97 + n%26)
    n = n//26
for c in reversed(ans):
    print(c, end="")

Submission status: Accepted

Solution code:
def int_to_str(n):
    if n == 0:
        return "a"
    elif n == 1:
        return "b"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"
    elif n == 2:
        return "c"

def Base_10_to_n(X, n):
    if (int(X/n)):
        if X%n != 0:
            return Base_10_to_n(int(X/n), n)+chr((X%n)+96)
        else:
            return Base_10_to_n(int(X/n)-1, n)+chr(26+96)
    if(X%n != 0):
        return str(chr(X%n+96))
    else:
        return ""

N = int(input())

s = Base_10_to_n(N,26)
print(s)

Submission status: Accepted

Solution code:
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())

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

Submission status: Accepted

Solution code:
N = int(input())

# 26進数に変換する問題
ans = ""
alphabet = "Xabcdefghijklmnopqrstuvwxyz"
while N > 0:
    mod = N % 26
    if mod == 0:
        mod = 26
    ans = alphabet[mod] + ans
    N -= mod
    N //= 26

print(ans)

Submission status: Accepted

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

while N>0:
    N-=1
    N_mod=N%26
    N=N//26
    N_26.append(chr(97+N_mod))
print("".join(list(reversed(N_26))))

Submission status: Accepted

Solution code:
# author:  Taichicchi
# created: 15.09.2020 21:11:53

import sys

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())
S="abcdefghijklmnopqrstuvwxyz"
ans=[]
while N>0:
    N-=1
    ans.append(S[N%26])
    N//=26
print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
num2alpha = lambda c: chr(c+64)


N = int(input())
degit = 0
temp_degit = 0
top=0

for i in range(1,50):
    temp_degit += 1
    under = top+1
    top += 26**i
    # print(temp_degit)
    # print(under,top)
    if under <= N and N <= top:
        degit = temp_degit
# print(degit)

# print(N%26)
arr =[]
for i in range(degit):
    if N%26==0:
        arr.append(26)
        N -=1
    else:  
        arr.append(N%26)
    N//=26
    # print(N)

rsl=""
# print(arr)
# print(num2alpha(10))
for i in reversed(arr):
    rsl += num2alpha(i)
print(rsl.lower())

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    # 桁数を求める
    n_digit = 0
    idx = 0
    while True:
        n_digit += 1
        n_str = 26 ** n_digit
        if idx + 1 <= N <= idx + n_str:
            idx += 1
            break
        else:
            idx += n_str

    k = N - idx
    ans = ''
    for i in range(n_digit):
        ans += chr(ord('a') + k % 26)
        k //= 26
    print(ans[::-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    result = []
    
    while N > 0:
        N -= 1
        mod = N % 26
        result.append(chr(mod + ord('a')))
        N //= 26

    result_str = ""
    for i in range(len(result)-1, -1, -1):
        result_str += result[i]

    print(result_str)

main()

Submission status: Accepted

Solution code:
n = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
s = ''
while n:
  n -= 1
  e = n % 26
  s = al[e] + s
  n //= 26
print(s)

Submission status: Accepted

Solution code:
N=int(input())
c=0;
while N-26**c>=0:
  N-=26**c
  c+=1
d=[0]*(c-1)
i=0
for i in range(c):
  d.insert(c-1,N%26)
  N=(N-d[i])//26
  i+=1
e=[]
s=''
for i in range(2*c-1):
  e.append(chr(97+d[i]))
  s+=e[i]
print(s[c-1:2*c-1])

Submission status: Accepted

Solution code:
N=int(input())
c=0;
while N-26**c>=0:
  N-=26**c
  c+=1

d=[0]*(c-1)

i=0
for i in range(c):
  d.insert(c-1,N%26)
  N=(N-d[i])//26
  i+=1
#print(d)
e=[]
s=''
for i in range(2*c-1):
  e.append(chr(97+d[i]))
  s+=e[i]
print(s[c-1:2*c-1])
#1000000000000001
#zzzzzz
#321272416

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

tmp = n
ans = []

while tmp >= 1:
    tmp -= 1
    #print(tmp,tmp%26)
    ans.append(chr(ord("a")+tmp % 26))
    tmp //= 26
    
print(*ans[::-1],sep="")

Submission status: Accepted

Solution code:
n = int(input())
al = 26
alf='abcdefghijklmnopqrstuvwxyz'
na = ''
while n >26:
  na = alf[(n-1)%al]+na
  n = (n-1)//al

na = alf[(n-1)%al]+na
print(na)

Submission status: Accepted

Solution code:
N = int(input())

ans = ''

while True:
    n = int(N / 26)
    r = N % 26

    if r == 0:
        r = 26
        n -= 1

    ans = chr(96 + r) + ans
    if n == 0:
        break
    else:
        N = n

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
alphabet = list("abcdefghijklmnopqrstuvwxyz")
res = ""

while (N > 0):
    N -= 1
    num = int(N % 26)
    res += alphabet[num]
    N /= 26
    N = N // 1

print(res[::-1])

Submission status: Accepted

Solution code:
N=int(input())
alpha='abcdefghijklmnopqrstuvwxyz'
 
ans=''
while 26<N:
    s=(N-1)%26
    ans=alpha[s]+ans
    N=int(N-1)//26
ans=alpha[N-1]+ans
print(ans)

Submission status: Accepted

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

N = int(input().split()[0])
a_list = list(string.ascii_lowercase)

amari_list = []
n = N
while n > 0:
    n -= 1
    amari = n % 26
    amari_list.append(a_list[amari])
    n = n // 26

ans = "".join(reversed(amari_list))

print(ans)

Submission status: Accepted

Solution code:
x,ar=int(input())-1,[]
if(x==0): ar.append('a')
else:
    while(x>0):
        ar.append(chr(97+x%26))
        x//=26
        x=x-1
        if(x==0): ar.append('a')
ar.reverse()
ans=''.join(ar)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
alpha='abcdefghijklmnopqrstuvwxyz'

ans=''
while 26<N:
    s=(N-1)%26
    ans=alpha[s]+ans
    N=int(N-1)//26
ans=alpha[N-1]+ans
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = ""
for i in range(14):
    if n == 0:
        break
    else:
        n -= 1
        ans += chr(ord("a") + n % 26)
        n = n//26

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

Submission status: Accepted

Solution code:
n = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ''
while n > 0:
    n -= 1
    ans = s[n % 26] + ans
    #Floor division
    n //= 26
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

l_list = []
ans = ''
while n > 0:
    if n % 26 == 0:
        l_list.append(26)
        n = n // 26 - 1
    else:
        l_list.append(n%26)
        n = n // 26
l_list = l_list[::-1]
for i in l_list:
    ans += a_list[i-1]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

ans=""
while n>0:
    n -=1
    n,b=divmod(n,26)
    ans +=chr(97+b)

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
alf = "0abcdefghijklmnopqrstuvwxyz"
ans = ""

while n != 0:
    x = n%26
    
    if x == 0:
        x = 26
        
    ans += alf[x]
    n -= x
    n //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
ret = ""
alphabet = list("abcdefghijklmnopqrstuvwxyz")
while n:
  n -= 1
  n, mod = divmod(n, 26)
  ret += alphabet[mod]
print(ret[::-1])

Submission status: Accepted

Solution code:
N = int(input())

az = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

while N:
    N -= 1
    ans = az[N%26] + ans
    N = N // 26

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = ' '
while N>0:
    N -= 1
    ans += chr(ord('a')+N%26)
    N = int(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:
import sys , math
from bisect import bisect
N=int(input())
alp="abcdefghijklmnopqrstuvwxyz"

R=[]
i=1
tot = 0
while tot < 1000000000000001:
    tar = 26**i
    tot+=tar
    R.append(tot+1)
    i+=1
keta = bisect(R , N)+1

if keta == 1:
    print(alp[N-1])
    sys.exit()

ans = ""
M = N - R[keta - 1]
for i in range(keta):
    j = keta - i - 1
    ind = M // (26**j)
    M -= ind * (26**j)
    ans+=alp[ind]
print(ans)

Submission status: Accepted

Solution code:


def main():
    N = int(input())
    digits = []

    while N != 0:
        digits.append(N % 26)
        if digits[-1] == 0:
            digits[-1] = 26
            N //= 26
            N -= 1
        else:
            N //= 26
    digits.reverse()
    for d in digits:
        print(chr(96 + d), end='')
    print()  # 改行


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A = int(input())
az = 'zabcdefghijklmnopqrstuvwxy'
ans = ''
abc = 'abcdefghijklmnopqrstuvwxyz'

while (A):
  A -= 1
  ans = abc[A % 26] + ans
  A = A // 26
print(ans)

Submission status: Accepted

Solution code:
A = int(input())
az = 'zabcdefghijklmnopqrstuvwxy'
ans = ''

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

Submission status: Accepted

Solution code:
n = int(input())
b = 26
ans = []
for i in range(1,99):
    if n <= b**i:
        n -= 1
        for j in range(i):
            ans.append(chr(97 + n % b))
            n //= b
        break
    else:
        n -= b ** i
for k in range(1,len(ans)+1):
    print(ans[-k],end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = 1
t = 0
while N > 26**s + t:
    t += 26**s
    s += 1
N -= t
ans = []
for i in range(s):
    c = 0
    while N > 26**(s-i-1):
        N -= 26**(s-i-1)
        c += 1
    ans.append(chr(97+c))
print("".join(ans))

Submission status: Accepted

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

while(n):
    n -= 1
    #print('value:',ord('a') + n % 26)
    ans += chr(ord('a') + n % 26)
    n //= 26

print("".join(list(ans[::-1])))

Submission status: Accepted

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

    alphabets = 'zabcdefghijklmnopqrstuvwxy'
    answer_reversed = ''
    for i in range(100):
        idx = n % 26
        answer_reversed += alphabets[idx]
        if idx == 0:
            n -= 26
        else:
            n -= idx
        if n:
            n = n // 26
        else:
            break
    print(answer_reversed[::-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=26
b=1
import math
import string
array=list(string.ascii_lowercase)
while n>a:
  b+=1
  a+=26**b
if b==1:
  print(array[n-1])
else:
  c=b-1
  d=n-a
  brray=[0]
  crray=[d]
  for i in range(c):
    brray.append(math.ceil(crray[i]/(26**(c-i))))
    crray.append(crray[i]%(26**(c-i)))
  ans=array[brray[1]-1]
  if c>1:
    for j in range(2,b):
      ans=ans+array[brray[j]-1]
  ans=ans+array[crray[c]-1]
  print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def calc(m, res):
        q, mod = divmod(m, 26)
        if (mod == 0):
            q = q - 1
            mod = 26
            res = chr(ord("a") + (mod - 1)) + res
        else:
            res = chr(ord("a") + (mod - 1)) + res
        if (q > 0):
            calc(q, res)
        else:
            print(res)
        return
    
calc(n, "")

Submission status: Accepted

Solution code:
n=int(input())

s = ''
for i in range(11):
  if n != 0:
    n -= 1
    s += chr(ord('a') + n % 26)
    n //= 26
print(s[::-1])

Submission status: Accepted

Solution code:
alfa = "0abcdefghijklmnopqrstuvwxyz"
N = int(input())
n = N
res = ""
while True:
    x = n % 26
    if x == 0:
        x = 26
    res += alfa[x]
    n -= x
    if n == 0:
        break
    n //= 26
print(res[::-1])

Submission status: Accepted

Solution code:
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:
N = int(input())

alp = "abcdefghijklmnopqrstuvwxyz"
answer = ""

while N != 0:
  N -= 1
  index = N % 26
  answer += alp[index]
  N = N // 26
  
print(answer[::-1])

Submission status: Accepted

Solution code:
import string

n = int(input())
s = ''
lowCase = string.ascii_lowercase

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

print(s[::-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 02:42:25 2020

@author: liang
"""

"""
n進数問題
【原則】　大きな数の計算をしない
　⇒　１の桁から計算する
 
171-C いびつなn進数

27 -> a(26)a(1)となる
　⇒先にa(1)だけもらってN%26とすることで解決
 
ASCII化 ord()
文字化　chr()
"""

N = int(input())

res = str()

while N > 0:
    N -= 1 #"a"として予め設置
    res += chr(ord("a") + N%26)
    N //= 26

print(res[::-1])

Submission status: Accepted

Solution code:
alp = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
keta = 0
a = 0
answer = ''
while a < n:
    keta += 1
    a += 26**keta
a -= 26**keta
n -= a+1
for i in range(keta-1):
    answer += alp[n // (26 ** (keta-i-1))]
    n = n % (26 ** (keta-i-1))
answer += alp[n % 26]
print(answer)

Submission status: Accepted

Solution code:
def numtoalpha(n):
	
	if n <= 26:
		return chr(96+n)
	elif n % 26 == 0:
		return numtoalpha(n//26-1) + chr(96+26)
	else :
		return numtoalpha(n//26) + chr(96+(n%26))

if __name__ == '__main__':

	n = int(input())

	print(numtoalpha(n))

Submission status: Accepted

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

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

Submission status: Accepted

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

num = int(math.log(1000000000000001, 26))
#print(num)

#余り
y, z = n, n
y_lis = []
#商
for i in range(100):
    if z >= 1:
        y_lis.append(z % 26)
        z = z // 26
    elif z == 0:
            break
#print(y_lis)


for i in range(len(y_lis) - 1):
    if y_lis[i] <= 0:
        y_lis[i] = y_lis[i] + 26
        y_lis[i + 1] -= 1

if y_lis[-1] == 0:
    y_lis.remove(y_lis[-1])
#print(y_lis)
y_lis = list(reversed(y_lis))
ans = ""
for i in range(len(y_lis)):
    y_lis[i] = chr(y_lis[i] + 96)
    ans += y_lis[i]
print(ans)

Submission status: Accepted

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

n = int(input())

ans = num2alpha(n)

print(ans.lower())

Submission status: Accepted

Solution code:
def one_and_one():
    lis = list("abcdefghijklmnopqrstuvwxyz")
    N = int(input())
    res = ""
    n = N - 1
    while n >= 0:
        res = lis[n % 26] + res
        n = n // 26 - 1
    print(res)
    
one_and_one()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    ans = ""
    while n > 0:
        n -= 1
        ans = chr(n%26 + ord('a')) + ans
        n //= 26
    print(ans)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

digits = []
letters = ''

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

for x in digits[::-1]:
    letters += chr(x+97)
print(letters)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    alp = 'abcdefghijklmnopqrstuvwxyz'
    answer = ''

    while n >= 1:
        n -= 1
        answer += alp[n % 26]
        n //= 26

    real_answer = ''
    for i in range(1, len(answer) + 1):
        real_answer += answer[-i]

    print(real_answer)


if __name__ == '__main__':
    main()

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 collections import deque  # dequeはappendleftができるので。

letter = ['z'] + [chr(i) for i in range(97, 123)]  # [0, a, b, c, ... , z]というリスト

N = int(input())

i = 0
n_24 = deque()

while N > 0:
    n_24.appendleft(N % 26)
    if N%26== 0:
        N -= 26
    N = N // 26

ans = ''

for dig in (n_24):
    ans += letter[dig]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = ''

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

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

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

print(out[::-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:
def resolve():
    N = int(input())
    ans = ""
    while N > 0:
        rem = N % 26
        rem = 25 if rem == 0 else rem - 1
        ans = chr(ord("a")+rem) + ans
        N = (N-1) // 26
    print(ans)


if '__main__' == __name__:
    resolve()

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:
import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())

a=""

l=[]
while n>0:
    n-=1
    mod=n%26
    n//=26
    l.append(mod)
#print(l)
for i in range(len(l))[::-1]:
    a+=chr(97+l[i])
print(a)

Submission status: Accepted

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

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

print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
ans=""
while n>0:
    
    c=chr((n-1)%26 + 97)
    ans = c+ans
    n = (n-1)//26
    
print(ans)

Submission status: Accepted

Solution code:
from itertools import accumulate
import numpy as np
N=int(input())
N-=1
L=[26**(i+1) for i in range(15)]
sL=list(accumulate(L))
result=[]
k=0
for i in range(15):
    if N+1<=sL[i] and N>=25:
        N-=sL[i-1]
        k=i
        break
for m in range(k):
    time=0
    while N>=L[k-m-1]:
        N-=L[k-m-1]
        time+=1
    result.append(chr(time+97))
result.append(chr(N+97))
print(''.join(result))

Submission status: Accepted

Solution code:
n = int(input())
s = 0
lst = []
al = [chr(ord('a') + i) for i in range(26)]

while True:
  if n == 0:
    break
  else:
    b = n%26
    if b == 0:
      b = 26
      n = (n-26)//26
    else:
      n = n//26
    
    lst.append(al[b-1])

lst.reverse()
x = ''.join(lst)
print(x)

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    ans=''
    while(n):
        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())


y=[]
for i in range(12):
  y.insert(0,chr(97+(n-1)%26))
  if (n-1)//26>=1:
    n=(n-1)//26
  else:
    break
    

print(''.join(y))

Submission status: Accepted

Solution code:
def alp(c):
    return chr(c+64)

def Base10to(n,k):
    if(int(n/k)):
        if n%k ==0 and n/k==1:
            return str(alp(26))
        elif n%k ==0:
            return Base10to(int((n/k)-1),k)+str(alp(26))
        else:
            return Base10to(int(n/k),k)+str(alp(n%k))
    return str(alp(n%k))

n = int(input())
k = 26

ans = Base10to(n,k)
print(ans.lower())

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())
ans = []
while(n > 0):
    x = n %  26
    n = n // 26
    if(x == 0):
        x = 26
        n -= 1
    ans.append(chr(x + ord('a') -1))
    # print(x,n)
ans.reverse()
print("".join(ans))

Submission status: Accepted

Solution code:
n = int(input())

abc = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n:
    n -= 1
    n, m = divmod(n, 26)
    ans = abc[m] + ans
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

sub = []
while n > 0:
    if n != 0:
        n -= 1
    sub.append(chr(97 + n % 26))
    n = n // 26

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
res = []
arufa = []
for i in range(97, 123):
    arufa.append(chr(i))
while n:
    if n == 0:
        break
    n -= 1
    res.append(arufa[int(n % 26)])
    n //= 26
res.reverse()
ans = "".join(res)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ls = []
while N > 0:
    N -= 1
    a = N % 26
    N //= 26
    ls.append(a+97)
print("".join(map(chr, reversed(ls))))

Submission status: Accepted

Solution code:
eList = [chr(i) for i in range(97, 97+26)]
N = int(input())

n = N
mod = N
numList = []

while n > 0:
    n, mod = divmod(n, 26)
    if mod != 0:
        # 末尾ではなく先頭に追加する
        # 1のくらいから判定して行っているため
        numList.insert(0, mod - 1)
    else:
        numList.insert(0, 25)
        # 26進数のようで26まで数字があるため調整する
        n -= 1

ans = ''
for num in numList:
    ans += eList[num]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

N = N - 1

tmp1 = 0
for i in range(1, 1000):
    tmp1 += 26 ** i
    if tmp1 > N:
        num = i
        tmp1 -= 26 ** i
        N -= tmp1
        break

tmp = [0 for _ in range(num)]
for i in range(num):
    tmp[i] = N%26
    N = N // 26

ans = ""
for i in range(len(tmp)):
    ans = az[tmp[i]] + ans

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
eList = ['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
mod = N
numList = []
 
while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
ans =''
for num in numList:
  ans += eList[num]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
Created on 2020/08/31

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  ans=""
  while N:
    N-=1
    ans+=chr(97+N%26)
    N=N//26
  print(ans[::-1])
  return
main()
#解説AC

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

alphabet="abcdefghijklmnopqrstuvwxyz"
def get_keta(n):
    i=1
    check=26
    while True:
        if n<=check:
            return i
        check=check*26+26
        i+=1

def get_new_n(n, keta):
    new_n = n
    for i in range(1, keta):
        new_n -= 26 ** i
    return new_n

keta=get_keta(n)
n=get_new_n(n,keta)-1
ans=[]
for i in range(keta):
    ans.append(alphabet[n%26])
    n-=n%26
    n=n//26

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import string

l = [c for c in string.ascii_lowercase]
def f(N: int):
    N -= 1
    if N // 26:
        return f(N//26) + l[N%26]
    else:
        return l[N%26]

def solve(N):
    print(f(N))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
    N = int(input())

    lb, ub = 0, 0
    for n_digit in range(1, 100):
        lb = ub + 1
        ub = (ub + 1) * 26
        if lb <= N <= ub:
            off = N - lb
            res = []
            while off > 0:
                off, r = divmod(off, 26)
                res.append(r)
            while len(res) < n_digit:
                res.append(0)
            res.reverse()
            res = ''.join([chr(ord('a') + x) for x in res])
            return res
    
print(solve())

Submission status: Accepted

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

n=n-1
a.append(chr(ord('a') + n%26))
a.reverse()
print("".join(a))

Submission status: Accepted

Solution code:
n = int(input())

str = ""

while 1:
    n, mod = divmod(n, 26)
    if mod == 0:
        str = 'z' + str
        n -=1
    else:
        str = chr(96+mod) + str

    if n == 0:
        break

print(str)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
n = int(input())
str = ''
a = ord('a') - 1
while True:
  z = n % 26 if n % 26 > 0 else 26
  str = chr(a + z) + str 
  n = n // 26 if n % 26 > 0 else n // 26  -1
  if n == 0:
    print(str)
    break

Submission status: Accepted

Solution code:
alpha = [chr(i + 97) for i in range(26)] 
N = int(input())
name = ''
while N >= 1:
  N -= 1
  _ = N % 26
  name += alpha[_]
  N //= 26
  
print(name[-1::-1])

Submission status: Accepted

Solution code:
N = int(input())
M = 26
n = 0
m = 1
s = [0, 0]
while s[1] < N:
  m *= M
  s[0] = s[1]
  s[1] += m
  n += 1
N = N - s[0] - 1
ans = ""
for i in range(n):
  ans = chr(ord("a") + (N % M)) + ans
  N //= M
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
p=1
while n > 0:
  n-=26**p
  p+=1
else:
  p-=1
  if n==0:
    ans="z"*p
    print(ans)
  else:
    n+=26**p
    num=[]
    for i in range(1,p+1):
      if n%(26**(p-i))==0:
        a=int(n/(26**(p-i)))-1
        q=p-i
        num.append(a)
        break
      else:
        a=n//(26**(p-i))
        num.append(a)
        n-=a*(26**(p-i))
    al=[]
    if n==0:
      for i in range(p-1):
        m=chr(97+num[i])
        al.append(m)
      al.append(chr(96+num[p-1]))
      ans=''.join(al)
    else:
      for i in num:
        m=chr(97+i)
        al.append(m)
      al.append("z"*q)
      ans=''.join(al)
    print(ans)