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())
lst = []
for i in range(1,12):
    if N <= 26 :
        lst.append(N % 26)
        break
    lst.append(N % 26)
    if N % 26 == 0:
        N = N // 26 - 1
    else:
        N = N // 26

chr = 'abcdefghijklmnopqrstuvwxyz'
res = ""
for j in lst:
    res = chr[j-1] + res
print(res)

Submission status: Accepted

Solution code:
n=int(input())
s = ""
cons = 96

if n%26:
    s+=chr(cons + n%26)
else:
    n-=1
    s+="z"
n = n//26

while n:
    if n%26:
        s+=chr(cons + n%26)
    else:
        n-=1
        s+="z"
    n = n//26
    
print(s[::-1])

Submission status: Accepted

Solution code:
N = int(input())
s = ""
words = "abcdefghijklmnopqrstuvwxyz"
while N > 0:
    if N%26 == 0:
        amari = 26
    else:
        amari = N%26
    if N > 26:
        N = (N-amari)/26
    else:
        N = N-26
    s = words[int(amari-1)]+s
print(s)

Submission status: Accepted

Solution code:
x = int(input())

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy > 0:
      if X_dumy % n == 0:
        out.append( 26 )
        X_dumy = int(X_dumy / n - 1)
      else:
        out.append( X_dumy % n )
        X_dumy = int(X_dumy / n)
    return out
if 1 <= x <= 1000000000000001:
    out = Base_10_to_n(x, 26)[::-1]
    print( "".join(alphbet(i) for i in out).lower())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

def b26(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        if X_dumy%26==0:
            out=str(26)+' '+out
            X_dumy=int(X_dumy/n)-1
        else:
            out = str(X_dumy%n)+' '+out
            X_dumy = int(X_dumy/n)
    return out

for a in b26(N,26).split():
    print(chr(96+int(a)),end='')
print('')

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while True:
    q, mod = divmod(n, 26)
    if mod == 0:
        ans = 'z' + ans
        q -= 1
    else:
        ans = (chr(ord('a') + mod-1)) + ans
    if q == 0:
        break
    else:
        n = q
print(ans)

Submission status: Accepted

Solution code:
num = int(input())
strng = ""
while num >= 1 :
    kalan = num % 26
    if(kalan==0):
      strng = "z" +strng
    else:
    	strng = chr(96+kalan)+strng
    num-=1
    num = num // 26
print(strng)

Submission status: Accepted

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

dividend = n
columnName = ''
modulo = 0

while dividend > 0:
    modulo = (dividend - 1) % 26
    columnName = chr(97 + modulo) + columnName
    dividend = int((dividend - modulo) / 26)
print(columnName)

Submission status: Accepted

Solution code:
MAX = 50
  
# Function to print Excel column name  
# for a given column number 
def printString(n): 
  
    # To store result (Excel column name) 
    ans=""
  
    # To store current index in str which is result 
    i = 0
  
    while n > 0: 
        # Find remainder 
        rem = n % 26
  
        # if remainder is 0, then a  
        # 'Z' must be there in output 
        if rem == 0: 
            ans= ans+'z'
            i += 1
            n = (n // 26) - 1
        else: 
            ans+= chr((rem - 1) + ord('a')) 
            i += 1
            n = n //26
    
  
    # Reverse the string and print result 
    ans=ans[::-1]
    #string=string.lower()
    print(ans)
  
n=int(input())
printString(n)

Submission status: Accepted

Solution code:
N = int(input())
ans = []
while N > 26:
    if N % 26 == 0:
        ans.append(26)
        N -= 26
    else:
        ans.append(N % 26)
    N //= 26
ans.append(N)
moji = ''
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)
for a in ans[::-1]:
    moji += num2alpha(a)
print(moji.lower())

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


a_list = 'abcdefghijklmnopqrstuvwxyz'


def base_convert(nl, ibase, obase):
    o = []
    while any(nl):
        c = 0
        for i in range(len(nl)):
            c = c * ibase + nl[i]
            nl[i], c = divmod(c, obase)
        o.append(c)
    o.reverse()
    return o


def main():
    input = stdin.buffer.readline
    N = int(input())
    if N == 1:
        print('a')
    else:
        arr = [1]
        tmp = 1
        while arr[-1] <= 1000000000000001:
            tmp *= 26
            arr.append(tmp)
        k = 0
        while N >= arr[k]:
            N -= arr[k]
            k += 1
        n = [int(i) for i in list(str(N))]
        idx = base_convert(n, 10, 26)
        idx = [0] * (k - len(idx)) + idx
        print(*[a_list[i] for i in idx], sep='')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
n=int(input())
al=[chr(ord('a') + i) for i in range(26)]
sakai=[]
k=0
for i in range(10):
  k+=26**(i+1)
  sakai.append(k)

if n<=26:
  n-=1
  u=1
elif n>sakai[9]:
  n-=sakai[9]+1
  u=11
for i in range(9):
  if (sakai[i]<n<=sakai[i+1]):
    n-=sakai[i]+1
    u=i+2

def base(n):
  ans=[]
  while(n>=26):
    r=n%26
    n=(n-r)//26
    ans.append(r)
  ans.append(n)
  return ans


p=base(n)

if u-len(p)>0:
  ans_3='a'
  if u-len(p)>1:
    for j in range(u-len(p)-1):
      ans_3+='a'
    
for i in range(len(p)):
  if i==0:
    ans_2=al[p[len(p)-i-1]]
  else:
    ans_2=ans_2+al[p[len(p)-i-1]]
if u-len(p)>0:
  print(ans_3+ans_2)
else:
  print(ans_2)

Submission status: Accepted

Solution code:
N=int(input())
res=[]
while N>0:
	tmp=N%26
	N//=26
	if tmp==0:
		tmp=26
		N-=1
	res+=[tmp]
res.reverse()
print(''.join([chr(ord('a')+i-1) for i in res]))

Submission status: Accepted

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

ans = []
while True:
    ans.append(N%26)
    if N%26 == 0:
        N -= 1
    if  N//26 == 0:
        break
    N//=26
for x in reversed(ans):
    print(table[x-1],end='')

print()

Submission status: Accepted

Solution code:
# import math

n = int(input())
r = ""
while n > 0:
	cur = n % 26
	if cur == 0:
		n -= 26
		cur = 26
	n //= 26
	r = chr(ord('a')+cur-1)+r
print (r)

Submission status: Accepted

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

print(nu(int(input())))

Submission status: Accepted

Solution code:
N = int(input())
ans = []
while(True):
  m = N % 26
  if m == 0:
    m = 26
  ans.append(m)
  N -= m
  N = N // 26
  if N == 0:
    break

# print(ans)

ans.reverse()
print(''.join(map(lambda i: chr(96 + i), ans)))

Submission status: Accepted

Solution code:
n = int(input())

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


while(n != 0):
    am = n%26
    
    n = n//26
    
    re.append(al[am])
    
    if(am == 0):
        n -=1
    
re.reverse()

for i in re:
    print(i,end="")

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

Solution code:
import itertools
N = int(input())
#N = int(input())
#N = int(input())
#S = input()
#M,N = map(int,input().split())
#M,N = map(int,input().split())
#A = list(map(int,input().split()))
#A = list(map(int,input().split()))
alp = ["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"]
check = 1
digit = 1
while True:
    if N < check:
        break
    check += 26**digit
    digit += 1
digit -= 1
check -= 26**digit
check -= 1
ans = [0]*digit
n = N - check
D = digit
for i in range(digit):
    syo = n // 26**(digit-1-i)
    if n % 26**(digit-1-i) == 0:
        syo-=1
    ans[i] = alp[syo]

    n -= syo*26**(digit-1-i)

print("".join(ans))

Submission status: Accepted

Solution code:
alp=[i for i in "abcdefghijklmnopqrstuvwxyz"]

n=int(input())
moji=""
while(n!=0):
  ind=n%26
  if ind==0:
    n=n//26-1
  else:
    n=n//26
  moji=alp[ind-1]+moji
print(moji)

Submission status: Accepted

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

p=[]
q=[-1]
keta=1
for i in range(10**4):
    p.append(26**i)
    q.append(q[-1]+p[i])
    if q[i]>N-1:
        keta=i-1
        break
#print(q)
#print("keta:",keta)
r=N-q[i-1]-1
#print("r:",r)
ans=""

for i in range(keta-1,-1,-1):
    s= 26**i
    t=r//s
    #print(t)
    ans += al[t]
    r %= s
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
an = []
alfa = 'abcdefghijklmnopqrstuvwxyz'
N -= 1
while True:
    amari = N % 26
    an.append(amari)
    if N < 26:
        break
    N = N // 26 - 1
ans = ''
for x in an :
    ans = alfa[x] + ans
print(ans)

Submission status: Accepted

Solution code:
char = ['', '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']
flag = False
def Base10ToN(x, n):
    if(x == 26): return char[26]
    if(int(x/n) != 0):
        if(int(x%n) != 0):
            return Base10ToN(int(x/n), n) + char[x%n]
        return Base10ToN(int(x/n) - 1, n) + char[26]
    else:
        if(int(x%n) != 0):
            return char[x%n]
        #return char[0]

n = int(input())
print(Base10ToN(n, 26))

Submission status: Accepted

Solution code:
N=int(input())
A=[]
for i in range(15):
  d=(N-1)%26
  e=(N-1)//26
  A.append(d+1)
  N=e
  if N==0:
    break
  
A=A[::-1]
r=''
for i in A:
  r=r+chr(96+i)
print(r)

Submission status: Accepted

Solution code:
N = int(input())

charList = [chr(i) for i in range(97, 97+26)]
ansStr = ""
while(True):
  amari = N % 26
  N = N//26
  if amari == 0:
    amari = 26
    N -= 1
  ansStr = charList[amari-1] + ansStr
  if N <= 0:
    break
print(ansStr)

Submission status: Accepted

Solution code:
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
n = int(input())
#n, k = map(int, sys.stdin.readline().split())
#s = input()
#p = list(map(int, sys.stdin.readline().split()))

x = [chr(ord('a') + i) for i in range(26)]
ans = []
while (n != 0):
    p = n // 26
    q = n % 26
    ans.append(x[q-1])
    r = (n-1) // 26
    n = r


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

Submission status: Accepted

Solution code:
N = int(input())
alf = []
while 0 < N:
    if N % 26 ==0:#Z
        alf.append('z')
        N = N//26-1
    else:
        alf.append(chr((N % 26)+96))
        N = N//26
alf.reverse()
alf = ''.join(alf)
print(alf)

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
tmp = 1
lst = []
s = 1
while tmp * 26 < n:
    tmp *= 26
    s += tmp
n -= s
while tmp >= 1:
    lst.append(n // tmp)
    n %= tmp
    tmp //= 26
alpha = 'abcdefghijklmnopqrstuvwxyz'
ans = []
for i in lst:
    if i >= 0:
        ans.append(alpha[i])
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    S = ''
    while N != 0:
        N, m = divmod(N, 26)
        if m == 0:
            N -= 1
            S = chr(122) + S
        else:
            S = chr(96 + m) + S
    print(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

ans = []
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def f(n):
  ans.append(alphabet[n%26-1])
  if n > 26:
    if n%26 == 0:
      f((n-26)//26)
    else:
      f((n-n%26)//26)


    
f(n)

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

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

abc='abcdefghijklmnopqrstuvwxyz'

n=int(input())

ans=''
while n!=0:
  t_ans=n%26
  ans+=str(abc[t_ans-1])

  if abc[t_ans-1]=='z':
    n-=1

  n//=26

print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())

a='abcdefghijklmnopqrstuvwxyz'
ans=''

x=0
while True:
    if (26**(x+1)-26)/25>=n:
        break
    x+=1
beam=x

for i in range(beam):
    x=n%26
    if x==0:
      x=26
    n=(n-x)//26
    ans+=a[x-1]
print(ans[::-1])

Submission status: Accepted

Solution code:
import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))

Submission status: Accepted

Solution code:
a=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)
z=num2alpha(a)
x=str.lower(z)
print(x)

Submission status: Accepted

Solution code:
MAX = 10000000000000001
AL = 26

N = int(input())

d = 1
ds = list()
while d <= MAX:
    ds.append(d)
    d = d * AL

ress = list()
for d in ds[-1::-1]:
    m = int(N / d)
    ress.append(m)
    N -= m * d

for _ in range(20):
    for i in range(len(ress) - 1):
        if ress[i] > 0 and ress[i + 1] == 0:
            ress[i] -= 1
            ress[i + 1] = 26

alphas = list(' abcdefghijklmnopqrstuvwxyz')

print(''.join([alphas[r] for r in ress]).strip())

Submission status: Accepted

Solution code:
n = int(input())

keta = 0
tmp = 26
beki = [26]

while True:
    if n <= beki[-1]:
        break
    tmp *= 26
    beki.append(beki[-1] + tmp)
    keta += 1
n_tmp = n
ans_num = []

n_tmp -= beki[keta - 1] + 1
for i in range(keta):
    waru = 26**(keta - i)
    x = (n_tmp) // waru
    ans_num.append(x)
    n_tmp -= x * waru

ans_num.append(n_tmp)
ans = ''

for d in ans_num:
    ans += chr(d + 97)

if n <= 26:
    print(chr(n + 96))
else:
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

cnt = 0
check = 0
while True:
    cnt += 1
    check += 26**cnt
    
    if n <= check:
        break

for i in range(1, cnt):
    n -= 26**i

ans = []

for i in range(1, cnt+1):
    temp = (n-1) // 26**(cnt-i)
    ans.append(li[temp])
    n -= temp*26**(cnt-i)

print("".join(ans))

Submission status: Accepted

Solution code:
N = int(input()) 
S = ''
K = (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10+ 26**11)

for outer  in range(11):
    K -= 26**(11 - outer)
    # print(K)
    if N > K:
        
        for iter in range(27):
            if N <= K + (iter) * 26**(11 - outer -1 ):
                S += chr(97+iter - 1)
                N -= (iter) * 26**(11 - outer - 1)
                break


# if N > (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9):
#     for iter in range(25):
#         if N < (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8) +iter * 26**9:
#             S += chr(97+iter)
#             N -= iter * 26**9
#             break



print(S)

Submission status: Accepted

Solution code:
def main():
    #input
    N=int(input())
    l=list("zabcdefghijklmnopqrstuvwxy")
    if N<26:
        print(l[N])
    else:
        name=[]
        n=N
        while n>=26:
            mod=n%26
            if mod!=0:
                n//=26
            else:
                n//=26
                n-=1
            name.append(l[mod])
        if n!=0:
            name.append(l[n])
        name=[name[n] for n in reversed(range(len(name)))]
        print("".join(name))

if __name__=="__main__":
    main()

Submission status: Accepted

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

y = int(input())

ans = []
while y > 26:
    res = y%26
    if res == 0:
        ans.append(25)
        y = y//26 - 1
    else:
        ans.append(y%26 - 1)
        y = y // 26
ans.append(y - 1)
ans = ans[::-1]
S = ''
for i in range(len(ans)):
    S += alp[ans[i]]
print(S)

Submission status: Accepted

Solution code:
n=int(input())
num=[]
t=1
count=1
while n>t*26:
    t *= 26
    n -= t
    count += 1
n -= 1
for i in range(count-1,-1,-1):
    m=26**i
    a=n//m
    n %= m
    num.append(a)
a_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=[]
for i in range(count):
    s=num[i]
    ans.append(a_list[s])
print(''.join(ans))

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict, deque
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
  
n=r()
s=''
while True:
    if n<=26:
        s+=chr(96+n)
        break
    z=(26 if n%26==0 else n%26)
    s+=chr(96+z)
    n-=z
    n//=26
print(s[::-1])

Submission status: Accepted

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

num = 1
while 26**num <= n:
    n -= 26**num
    num += 1

r = []
while 25 < n:
    r.append(n % 26)
    n //= 26

r.append(n)

if len(r) < num:
    for i in range(num - len(r)):
        r.append(0)

for i in r[::-1]:
    print(chr(97+i), end='')

Submission status: Accepted

Solution code:
n = int(input())
alfa = ['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']
re = []
while n > 26:
    re.append(int(n % 26))
    if int(n%26) == 0:
        n -= 1
    n = int(n / 26)
re.append(n % 26)
result = ''
for i in range(len(re)):
    result += alfa[re[len(re)-i-1]-1]
print(result)

Submission status: Accepted

Solution code:

def resolve():
    lower = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())    

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import io,sys
sys.setrecursionlimit(10**6)

def main():
    import math
    n = int(input())
    if n < 27:
        print(chr(n+ord("a")-1))
        sys.exit()

    p = n
    k = 1
    s = 1
    while p - 26*s > 0:
        s *= 26
        p -= s
        k += 1

    p-=1
    st = []

    for _ in range(k):
        r = p%26
        p = p//26
        st.append(r)


    for i in st[::-1]:
        print(chr(i+ord("a")),end="")
    print("")
main()

Submission status: Accepted

Solution code:
n = int(input())


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


print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
def F(P):
	r=0
	for i in range(P):
		r+=26**i
	return r

def f(c):
	for p in range(15,-1,-1):
		for coef in range(26,0,-1):
			if c- coef*(26**p) >= F(p):
				return coef, p
		

n=int(input())

c=n
t=[]
while c:
	x,p =f(c)
	# ~ print((x,p))
	t+=[x]
	c-=(x*(26**p))
# ~ print(t)
a=""
for j in t:
	a+=chr(j+97-1)
print(a)

Submission status: Accepted

Solution code:
n = int(input())
A = 'abcdefghijklmnopqrstuvwxyz'
ANS = []

while n > 0:
    r = n % 26
    if r == 0:
        r = 26
    ANS.append(r)
    
    if ANS[-1] == 26:
      n -= 1
    n = n // 26

ANS = reversed(ANS)

for a in ANS:
    print(A[a-1], end="")

Submission status: Accepted

Solution code:
import sys
import math

N = int(input())

mul = 0
quotient = N
dog_name = ""
while(quotient > 26):
    mod = quotient % 26
    if mod == 0:
        mod = 26
    dog_name = chr(mod+96)+ dog_name 
    quotient = math.floor(quotient // 26)
    mul += 1
    if mul > 0 and mod ==26:
        quotient -= 1
#    print(mul, quotient,mod)
if quotient > 0:
    dog_name = chr(quotient+96) + dog_name

print(dog_name)

Submission status: Accepted

Solution code:
import sys
import math

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

x=int(input())
print(alphabet_decimal(x))

Submission status: Accepted

Solution code:
n = int(input())

su=[26**i for i in range(1,20)]
from itertools import accumulate
wa = list(accumulate(su)) 
import bisect
c = 0
n = n-1
if n>26:
    c=bisect.bisect_left(wa, n)
    n=n-wa[c-1]
m = n
k=26
bi=[]
for i in range(c+1):
    
      bi.append(n % k)
      n = (n-n%k)//k
      
al=[chr(ord('a') + i) for i in range(26)]

li = [al[i] for i in bi]
li.reverse()
if m in su:
  li.append('a')

mojiretu = ''.join(li)

print(mojiretu)

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)
s = num2alpha(N)
print(s.lower())

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
#from collections import OrderedDict, defaultdict
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
#import numba

def run():
    dict = 'abcdefghijklmnopqrstuvwxyz'
    dict2 = 'zabcdefghijklmnopqrstuvwxy'
    ret = ''
    N = int(input())
    done = False
    while N:
        tmp = N % 26
        N = N // 26
        if tmp == 0:
            N -= 1
        ret = dict2[tmp] + ret
    print(ret)
if __name__ == "__main__":
    run()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = []
m = ord('a') - 1
x = 0
while 26 ** x <= n:
    x += 1
while x > 0:
    x -= 1
    tmp = n // (26 ** x)
    ans.append(tmp)
    n = n - tmp * (26 ** x)
for i in range(len(ans) - 1, -1, -1):
    if ans[i] == 0:
        if i == 0:
            ans[i] = ''
            continue
        ans[i] = chr(m + 26)
        j = i - 1
        while ans[j] == 0:
            ans[j] = 25
            j -= 1
        ans[j] -= 1
    else:
        ans[i] = chr(m + ans[i])
print(''.join(ans))

Submission status: Accepted

Solution code:
import string
alf = 'zabcdefghijklmnopqrstuvwxy'
x = int(input())

def x2a(x):
    s = ''
    while x != 0:
        div, mod = divmod(x, 26)
        s += alf[mod]
        if mod != 0:
            x = div
        else:
            x = div -1
    return s[::-1]
print(x2a(x))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    max_d = 1
    while N >= sum([26**i for i in range(max_d + 1)]):
        max_d += 1
    digits = [0 for _ in range(max_d)]
    for k in range(max_d - 1, -1, -1):
        r = N - sum([26**i for i in range(k)])
        digits[k] = r // (26 ** k)
        N -= digits[k] * (26 ** k)
    digits.reverse()
    ans = ''
    for d in digits:
        ans += chr(d - 1 + ord('a'))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
table = list('abcdefghijklmnopqrstuvwxyz')


def base10to(a, b):
    if (int(a / b)):
        return base10to(int(a / b)-1, b) + table[(a % b)]

    return table[(a % b)]


x2 = base10to(n-1, 26)
print(x2)

Submission status: Accepted

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

L = []

total = 0
keta = 1

while True:
    total += 26**keta
    if n <= total:
        break
    keta += 1

n -= (total-26**keta)
n -= 1

while n > 0:
    L.append(n%26)
    n //= 26

M = [0]*keta

for i in range(min(keta, len(L))):
    M[-(i+1)] = L[i]



ans = ""
for m in M:
    ans += A[m]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
      
result = str(num2alpha(N))
result = result.lower()
print(result)

Submission status: Accepted

Solution code:
# NK=list(map(int,input().split()))
N = int(input())
'''
An = list(map(int,input().split()))
Q = int(input())
Bn = [0] * Q
Cn = [0] * Q
for c in range(Q):
    Bn[c], Cn[c] = map(int, input().split())
'''

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"]

columnName = ""
modulo =0

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


print(columnName)

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

Submission status: Accepted

Solution code:
import string
a = int(input())
res = []
while(a>0):
  b = (a-1)%26
  res.append(string.ascii_lowercase[b])
  a -= b
  a = a//26
print(''.join(reversed(res)))

Submission status: Accepted

Solution code:
N = int(input())

alf = 'abcdefghijklmnopqrstuvwxyz'
A = list(alf)

name = []
while N > 26:
    tmp = 25
    if N % 26 != 0:
        tmp = N % 26 -1
        N //= 26
    else:
        N = N//26-1
    name.append(A[tmp])


name.append(A[N-1])
name.reverse()
print(''.join(name))

Submission status: Accepted

Solution code:
N = int(input())

def numal(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return numal(num//26-1)+chr(90)
    else:
        return numal(num//26)+chr(64+num%26)
      
ans = numal(N).lower()

print(ans)

Submission status: Accepted

Solution code:
def readinput():
    n=int(input())
    return n

def main(n):
    name=subname(n)
    return name

def subname(n):
    alph='abcdefghijklmnopqrstuvwxyz'
    if n <=26:
        return alph[n-1]
    else:
        r=n%26
        if r==0:
            addch='z'
            n=n-26
        else:
            addch=alph[r-1]
        q=n//26
        return subname(q)+addch


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

Submission status: Accepted

Solution code:
al = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
N = int(input())
M = N
v = 1
while True:
    if(M<=26**v):
        break
    M -= 26**v
    v += 1
for i in range(v):
    N -= 26**i  
ans = []
for i in range(v):
    ans.append("a")
for i in range(v):
    ans[-i-1]=al[N%26]
    N = N//26
ans.reverse()
anss = ""
for i in range(len(ans)):
    anss += ans[-i-1]
print(anss)

Submission status: Accepted

Solution code:
A=int(input())
m=0
for i in range(1,12):
    m+=26**i
    if A<m+1:
        break

li=["$"]*i
for j in range(i):
    li[j]=A%26
    if li[j]==0:
        A-=1
    A=int(A//26)
    if A==0:
        break


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

S=""
for k in range(i):
    S+=abc[li[i-1-k]]

print(S)