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 = []
keta = n//26
while n != 0:
    i = n%26
    if i == 0:
        o = 'z'
        n = n//26 -1
    else:
        o = chr(n%26 +96)
        n //= 26
    ans.append(o)
ans = reversed(ans)
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())

digit = 26

ans = ''
while N > 0:
    num = N % digit
    if num == 0:
        num = digit
    N -= num
    num /= (digit/26)
    num += 96
    ans += chr(int(num))
    digit *= 26
    
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

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

def naming(N):
    if(N == 0):
        name.reverse()
        print(''.join(name))
    else:
        a = N // 26
        b = N % 26
        if(b == 0):
            b = 26
            a -= 1
        name.append(alphabet[b-1])

        naming(a)

naming(N)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 21 21:03:27 2020

@author: NEC-PCuser
"""

N = int(input())

c = ""

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

a = 1
b = 1
while a <= N:
    moji_up_list.append(a)
    b *= 26
    a += b
    
N -= moji_up_list[len(moji_up_list) - 1]

j = 26 ** (len(moji_up_list) - 1)
for i in range(len(moji_up_list)):
    c += alpha_list[N // j]
    N = N % j
    j = j // 26

print(c)

Submission status: Accepted

Solution code:
n=int(input())-1
d=12
az=26
a=[]
b=[]
b0=0
for ii in range(d):
  a0=az**(ii+1)
  a.append(a0)
  b0+=a0
  b.append(b0)
for ii in range(d):
  if n<b[ii]:
    break
i0=b[ii]-a[ii]
n=n-i0

def func(ii,n):
  r=[]
  for jj in range(ii+1):
    azjj=az**(ii-jj)
    c=n//azjj
    r.append(chr(ord("a")+c))
    n=n%azjj
  return r
             
print("".join(func(ii,n)))

Submission status: Accepted

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

n = int(input())
print(num2alpha(n))

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)

output = num2alpha(n)
print(output.lower())

Submission status: Accepted

Solution code:
import re
def main():
    n = int(input())
    ans = []
    while n // 26 > 0:
        ans.append(chr(97 + (n-1)%26))
        n = (n - 1) // 26
    if n > 0:
        ans.append(chr(97 + (n-1)%26))

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

while N >= 26:
    m = N % 26
    if m == 0:
        ans = chr(96 + 26) + ans
        N //= 26
        N -= 1
    else:
        ans = chr(96 + m) + ans
        N //= 26
# print(ans, N)
if N == 0:
    print(ans)
else:
    print(chr(96 + N) + ans)

Submission status: Accepted

Solution code:
N = int(input())

count = 0
N_copy = N
while N_copy != 0:
    N_copy //= 26
    count += 1

ans = ""
alpha = "abcdefghijklmnopqrstuvwxyz"
for i in range(count):
    #print(N, ans)
    ans = alpha[N%26-1] + ans
    if N%26 == 0:
        N //= 26
        N -= 1
    else:
        N //= 26

if ans[0] == "z":
    print(ans[1:len(ans)])
else:
    print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

n = math.log((1 - (N * (1 - 26) // 26)), 26)

n = math.ceil(n)

S = 26 * (1 - 26 ** (n - 1)) // (1 - 26)

M = N - S - 1


res = ''

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

for i in range(n):
    index = i + 1

    s = M % (26 ** index)

    t = s // (26 ** i)

    res = arr[t] + res

    M -= s

print(res)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


#隣接リスト 1-order
def make_adjlist_d(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
        res[edge[1]].append(edge[0])
    return res


def make_adjlist_nond(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
    return res


#nCr
def cmb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n - r)


def main():
    N = NI()
    S = []
    L = ""
    cnt = 0

    while N > 0:
        S.append(N % 26)

        if N % 26 == 0:
            L = "z" + L
            N = N // 26 - 1
        else:
            L = chr(S[-1] + 96) + L
            N = N // 26

    print(L)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
maxx = 1000000000000001
leng = 1
h = 0
while True:
	h += pow(26,leng)
	if h >= n: break
	leng+=1
#print(leng)
s = ""
for i in range(leng):
	#print(i)
	x = (n-1)%26
	#print(n,x)
	s += chr(x+ord('a'))
	#print(chr(n%26+ord('a')-1))
	#n = n%pow(26,i)
	#print(n)
	#n = (n-pow(26,leng))//26
	#print(n)
	n = n//26
	if x==25: n -= 1
for i in range(leng-1,-1,-1):
	print(s[i],end="")
print()

Submission status: Accepted

Solution code:
n=int(input())

a=[]
n=n-1
while n > 25:
    a.append(n%26)
    n//=26
    n-=1

ans=""
for b in a:
    s=chr(ord('a')+b)
    ans+=s
ans+=chr(ord('a')+n)
for u in ans[::-1]:
    print(u,end="")

Submission status: Accepted

Solution code:
N = int(input())
N -= 1

alp = "abcdefghijklmnopqrstuvwxyz"



ans = ''
while N >= 0:
    j = N % 26
    if N == 0:
        ans += alp[j]
        break
    else:
        N = N // 26 - 1
        ans += alp[j]

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input()) - 1

lb, ub = 0, 0

for n_digit in range(1, 20):
    lb = ub
    ub = (ub + 1) * 26
    # print(n_digit, lb, ub)

    if lb <= N < ub:
        off = N - lb
        ans = ['a' for _ in range(n_digit)]
        idx = 1
        while off > 0:
            ans[-idx] = chr(ord('a') + off % 26)
            off //= 26
            idx += 1
        
        print(''.join(ans))
        break

Submission status: Accepted

Solution code:
import itertools
N = int(input())
seq = ("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 = (N * 25 + 26) / 26
ans = 1#文字数
#print(a)
while a > 26:
  a /= 26
  #print(a)
  ans += 1

p = (26 ** ans - 26) / 25
z = int(N - p)
#print(z, p, ans)
ans2 = [0] * ans
for i in range(ans):
  x = N % 26
  if x == 0:
    x = 26
  N = int((N - x) // 26)
  ans2[ans - i - 1] = x
  
#print(ans2)
for i in range(ans):
  print(seq[ans2[i] - 1], end = "")
  
#x = list(itertools.product(seq, repeat = ans))
#ans2 = x[N - 1]
#for i in range(len(ans2)):
#  print(ans2[i], end = "")
#print("")

Submission status: Accepted

Solution code:
n =int(input())-1
m=0
while 26*((26**m)-1)/25<= n:
    m+=1
m-=1
n= n - 26*((26**m)-1)/25 
ans=[]
for i in range(m,-1,-1):
    ans.append(n//(26**i))
    n= n% (26**i)
w=""
for i in ans:
    w=w + chr(int(i)+97)
print(w)

Submission status: Accepted

Solution code:
n = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
answer = ""
tmp = 0
while n > 0:
    tmp = n % 26
    answer += alphabet[tmp - 1]
    n = n // 26
    if tmp == 0:
        n -= 1

print(answer[::-1])

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)

s = int(input())

n = num2alpha(s)

print(n.lower())

Submission status: Accepted

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

n = int(input())
result = repeat(n)
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = int(input())

result = []
k = 26
i = 1

while k < n:
	n -= k
	k *= 26
	i += 1

length = i
n -= 1

result = []

pow26 = 26 ** (length - 1)
for i in range(length):
	letter = n // pow26 
	result.append(chr(ord('a') + letter))
	n = n % pow26
	pow26 //= 26

print("".join(result))

Submission status: Accepted

Solution code:
n = int(input())

alphabet = [chr(i) for i in range(97, 97+26)]
s = ''

while n > 0:
  tmp = n % 26
  s += alphabet[tmp - 1]
  if tmp == 0:
    n = (n - 1) // 26
  else:
    n = n // 26
print(s[::-1])

Submission status: Accepted

Solution code:
import sys

q = int(sys.stdin.readline())
chars = []
while True:
    q, mod = divmod(q-1, 26)
    chars.append(chr(mod+97))
    if q < 1:
        break
chars.reverse()
print("".join(chars))

Submission status: Accepted

Solution code:
n=int(input())
c=['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 = ''
tmp = 0

if n < 26:
    print(c[n-1])
    exit()

while(n > 0):
    tmp = int(n % 26)
    if tmp == 0:
        tmp = 26
    ans = c[tmp-1] + ans
    n = n - tmp
    n = n / 26

print(ans)

Submission status: Accepted

Solution code:
from math import *
a=int(input())
r=''
n=ceil(a/26)
while(n and a>0):
    n-=1
    c=a%26
    if(c!=0):
        r+=chr(97+c-1)
    else:
        r+='z'
    if(c==0):
        a=(a//26)-1
    else:
        a=a//26
print(r[::-1])

Submission status: Accepted

Solution code:
N = int(input())
NAME = 'abcdefghijklmnopqrstuvwxyz'
D = 26
name = ''

while N > 0:
  i = N % D
  name = NAME[i-1] + name
  N = int((N - i) / D)
  if i == 0:
    N -= 1
  
print(name)

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)

a=num2alpha(N)
print(str.lower(a))

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()
N -= 1

ans = ''
while N >= 0:
    d, m = divmod(N, 26)
    ans += chr(m+97)
    N = d - 1
ans = ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=""
while(n):
    a=n%26
    c=""
    if(a==0):
        c="z"
    else:
        c=chr(96+a)
    s+=c
    n=n//26
    if(c=="z"):
        n-=1
s=s[::-1]
print(s)

Submission status: Accepted

Solution code:
n = int(input())
ans = ""
alp = "abcdefghijklmnopqrstuvwxyz"
# while n>0:
#     temp = 0
#     for i in range(12):
#         temp += 26**(i+1)
#         print(temp)
#         if n <= temp:
#             print(i,(n//(26**(i)))-1,n,temp,ans)
#             ans += alp[(n//(26**(i)))-1]
#             n-=n//(26**(i+1))*26
#             print(n)
#             break

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

Submission status: Accepted

Solution code:
"""
NTC here
"""
 
 
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase

profile = 0
pypy = 1
 
 
def iin(): return int(input())


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


def main():
    # for n in range(1, 1000):
    n = iin()
    ans = []
    rf = ord('a')
    while n :
        x = n%26
        if x == 0:
            x = 26
        n -= 1
        n //= 26
        # print(x, n)
        ans.append(chr(x+rf-1))
    print(''.join(ans[::-1]))






    




                

        

 
 
 
 
 
 
# region fastio
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
if pypy:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
if __name__ == "__main__":
    if profile:
        import cProfile
        cProfile.run('main()')
    else:
        main()

Submission status: Accepted

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


temp=26
count=1
while True:
    if n<=temp:
        break
    else:
        count+=1
        temp+=26**count

unthink=temp-26**count
think=n-unthink

ans=''
think-=1
for i in range(count)[::-1]:
    now=think//(26**i)
    ans+=L[now]
    think=think%(26**i)

print(ans)

Submission status: Accepted

Solution code:
from string import ascii_lowercase as alph
N = int(input())
A = list(alph)

ans = []

def sol(n):
    global ans

    q, r = divmod(n, 26)
    ans.append(A[r])
    if q > 0:
        sol(q - 1)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

N = I()
A = [0]
for i in range(1,13):
    A.append(A[-1]+26**i)

ANS = []
for i in range(1,12):
    if N > A[i]:
        continue
    else:
        a = N-A[i-1]-1
        for j in range(i):
            ANS.append(a % 26)
            a = (a-a%26)//26
        break

ANS.reverse()

for i in range(len(ANS)):
    ANS[i] = chr(ANS[i]+97)

print(''.join(ANS))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
res = []
a=list("zabcdefghijklmnopqrstuvwxy")
while x > 0:
  if x % 26 == 0:
    res.append("z")
    x = x // 26 - 1
  else:
    res.append(a[x % 26])
    x = x // 26 

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

Submission status: Accepted

Solution code:
#float型を許すな
#numpyはpythonで
#dp
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

alphasm=[chr(i) for i in range(97, 97+26)]
n=I()
s=""
while n>0:
    n-=1
    x=n%26
    s+=alphasm[x%26]
    n=(n-x)//26
u=list(reversed(s))
print("".join(u))
#for i in range(15):
# print(26**i)

Submission status: Accepted

Solution code:
import string


N = int(input())
S = string.ascii_lowercase

ans = ''
if N <= 26:
    ans = S[N - 1]

else:
    while True:
        N, b = divmod(N, 26)
        ans = S[b - 1] + ans
        if b == 0:
            N -= 1

        if N <= 26:
            ans = S[N - 1] + ans
            break

print(ans)

Submission status: Accepted

Solution code:
#One Quadrillion and One Dalmatians
alphabet = list('abcdefghijklmnopqrstuvwxyz')
N = int(input())-1

def shin26(N):
    if(int(N/26)!=0):
        return(shin26(int(N/26)-1)+alphabet[N%26])
    return alphabet[N%26]

print(shin26(N))

Submission status: Accepted

Solution code:
n= int(input())

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

print(num2alpha(n))

Submission status: Accepted

Solution code:
from sys import stdin
import string
N = int(stdin.readline().rstrip())
alpha = string.ascii_lowercase
ans = ""

  
tmp = N
while N != 0:
    tmp = N % 26
    ans += alpha[tmp-1]
    if tmp == 0:
        N = (N-1) // 26
    else:
        N //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
c=[chr(i) for i in range(97, 97+26)]
l=[]
for i in range(1,20):
  l.append(26**i)
L=[0]
for i in range(len(l)):
  L.append(L[-1]+l[i])

for i in range(len(L)):
  if n<=L[i]:
    x=i
    break
y=n-L[x-1]
ans=[]
for i in range(x-1,0,-1):
  ans.append(c[(y-1+26**i)//(26**i)-1])
  y=y%(26**i)
ans.append(c[(y-1+26)%26])
print(''.join(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())
NN=num2alpha(N)
print(NN.lower())

Submission status: Accepted

Solution code:
import sys
import math

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

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

n = int(input())
print(alphabet_decimal(n))

Submission status: Accepted

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

while True:
    if n == 0:
        break
    ans.append(alp[n%26-1])
    n = (n - 1) // 26
ans.reverse()
print("".join(list(map(str, ans))))

Submission status: Accepted

Solution code:
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
l = []
while(1):
    if n<=26:
        if n!=0:
            l.append(n)
        break
    amari = n%26
    n = n//26
    if amari==0:
        l.append(26)
        n-=1
    else:
        l.append(amari)
a = ''
for i in l[::-1]:
    a+=s[i-1]
print(a)

Submission status: Accepted

Solution code:
N = int(input()) - 1
C = 'abcdefghijklmnopqrstuvwxyz'
res = ''
p = 1
while N - 26**p >= 0:
    N -= 26**p
    p += 1


def base(x, p):
    if int(x / p) >= 1:
        return base(int(x / p), p) + ' ' + str(x % p)
    return str(x % p)

a = list(map(int, base(N, 26).split()))

for i in range(p - len(a)):
    res += 'a'

for i in range(len(a)):
    res += C[a[i]]

print(res)

Submission status: Accepted

Solution code:
ans = []
n = int(input())
while n > 0:
    i = n % 26
    if i == 0:
        i += 26
    ans.append(chr(i + 96))
    if n % 26 == 0:
        n = n // 26 - 1
    else:
        n //= 26
ans.reverse()
print("".join(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:
N = int(input())
S = ''
while N:
	N -= 1
	S += (chr(N%26+ord('a')))
	N//=26

print(S[::-1])

Submission status: Accepted

Solution code:
import sys
import math

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

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

print(alphabet_decimal(int(N)))

Submission status: Accepted

Solution code:
N = int(input())

temp = []

while N > 0:
    q, r = divmod(N, 26)

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

    N = q

    temp.append(chr(96 + r))


print(''.join(temp)[::-1])

Submission status: Accepted

Solution code:
import sys

import string


characters = string.ascii_lowercase


def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except BaseException:
        raise ValueError('Invalid value:', value)

    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)

    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp % n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp % n
    result = characters[idx] + result
    return result


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    k = 1  # 桁数
    while True:
        if n <= 26**k:
            break
        n -= 26**k
        k += 1
    ans = base_cvt(n - 1, 26)
    if len(ans) < k:
        ans = 'a' * (k - len(ans)) + ans
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())-1

A = []

Alpha = "abcdefghijklmnopqrstuvwxyz"

while True:
    N,n = divmod(N,26)
    A.append(n)
    N-=1
    if N < 0:
        break

name = ""
for i in A:
    name = Alpha[i]+name

print(name)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
n = n - 1
mozi_list = []
while True:
    k = n % 26
    n = n // 26 - 1
    chr_s = chr(97 + k)
    mozi_list.append(chr_s)
    if n == -1:
        break
for i in range(len(mozi_list)):
    print(mozi_list[len(mozi_list)-i-1], end="")

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

n = ni()
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n > 0:
    t = (n-1) % 26
    n = (n-1) // 26
    ans = a[t] + ans
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:
import numpy as np

N = int(input())
a = np.zeros(10, dtype = int)
for i in range(10):
    for j in range(1, i + 2):
        a[i] += 26 ** j
for i in range(10):
    if N <= a[i]:
        keta = i + 1
        if i == 0:
            num = N
        else:
            num = N - a[i]
        break
else:
    keta = 11
    num = N - 146813779479510
num -= 1
ans = [0 for i in range(keta)]
for i in range(keta):
    ans[keta-i-1] = num % 26 + 97
    num //= 26
u = ''
for i in range(keta):
    u += chr(ans[i])
print(u)

Submission status: Accepted

Solution code:
n=int(input())
c=""
while(n>0):
    mod=n%26
    if mod==0:
        mod=26
    c+=chr(96+mod)
    n=(n-mod)//26
print(c[::-1])

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(input())
    name = ""
    while N:
        N, mod = divmod(N, 26)
        if mod ==0:
            name +="z"
            N-=1
        else:
            name += chr(96+mod)

    print(name[::-1])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

t = n
ans = ''
while t > 26:
    if t % 26 != 0:
        ans += chr(t % 26 + 96)
        t = int(t / 26)
    else:
        ans += 'z'
        t = int(t / 26) - 1

ans += chr(t + 96)
print(ans[::-1])

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())
nn = num2alpha(n)
print(nn.lower())

Submission status: Accepted

Solution code:
n = int(input())
alpha = [chr(ord('a') + i) for i in range(26)]
count = 1
m = n
while True:
    m -= 26 ** count
    if m > 0:
        count += 1
    else:
        m += 26 ** count
        break
keta = count
dec = m - 1

def Base_10_to_n(X, n):
    if (int(X/n)):
        a = alpha[X%n]

        return Base_10_to_n(int(X/n), n)+a
    else:
        a = alpha[X%n]
        return a
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = dec
x2 = Base_10_to_n(x10, 26)
if len(x2) < count:
    x2 = 'a'*(count - len(x2)) + x2
print( x2 )#"100011"が表示される．

Submission status: Accepted

Solution code:

n = int(input())
i = 0
buf = 0
while 26**i+buf<=n:
    buf += 26**i
    i += 1
ans = ''
for j in range(i):
    ans += chr(ord('a')+(n//(26**j)-1)%26)
    n -= 26**j
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

alp = 'Zabcdefghijklmnopqrstuvwxyz'

ans = ''

while n:
    if n<27:
        ans += alp[n]
        break
    else:
        t = n%26
        if not t:
            t = 26
        ans += alp[t]
        n = (n-t)//26

ans = ans[::-1]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
e_str = [chr(ord('a') + i) for i in range(26)]
ans = []
while n>0:
    n -= 1
    i = n % 26
    # print(i)
    ans.append(e_str[i])
    n = n// 26
    # print(n)
# print(e_str)
# print(ans)
ans.reverse()
a = ''.join(ans)
print(a)

Submission status: Accepted

Solution code:
n = int(input())-1
x = 26
d = 1
while n >= x:
  n -= x
  d += 1
  x *= 26
  
ans = ""
al = list("abcdefghijklmnopqrstuvwxyz")
tmp = pow(26,d)
for i in range(d-1,-1,-1):
  tmp //= 26 
  ans += al[n//tmp]
  n %= tmp
print(ans)

Submission status: Accepted

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

#S=input()
N = int(input())

N-=1

base=ord('a')

print_string=""

while (N >= 26):
  print_string=chr(base+N%26)+print_string
  N //= 26
  N-=1

#print(N)
print_string=chr(base+N%26)+print_string

#print(N)
print(print_string)
#N,K=list(map(int,input().split()))
#P=list(map(int,input().split()))

#P.sort()
#print(sum(P[:K]))

#print(A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input().strip())
ans=""
while n>0:
    n,mod=divmod(n,26)
    if mod==0:
        ans+="z"
        n-=1
    else:
        ans+=chr(ord("a")+mod-1)
print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

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