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:
import itertools

n = int(input())

keta = 1
abc_list = 'abcdefghijklmnopqrstuvwxyz'
c = 0
while keta < 17:
    c += 26 ** keta
    # print(keta)
    if n <= c:
        # print('keta', keta)
        num = (26 ** keta) - (c-n)-1
        # print('num', num)
        # print('   ', 26 ** keta)
        # print(befor)
        i_t = 0
        # print(i_list)
        ans = ''
        for i in range(keta-1, -1, -1):
            # print('i', i, num, (num // (26**i)))
            idx = num // (26 ** (i))
            # print(idx, abc_list[idx])
            ans += abc_list[idx]
            num -= (num // (26 ** i)) * (26 ** i)
        print(ans)
        break

    keta += 1

Submission status: Accepted

Solution code:
from string import ascii_lowercase

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

while n>0:
    c = n%26
    res.append(ascii_lowercase[c-1])
    if c==0:
        n = (n-26)//26
    else:
        n //= 26


res.reverse()
print("".join(res))

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","z"]
x=n
b=1
z=a[x%26-1]
x=x-26
while x>0:
    i=(x-1)//(26**b)
    y=i%26
    z+=a[y]
    b+=1
    x=x-(26**b)
t=z[::-1]
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import log, ceil
r = 26
ab = "abcdefghijklmnopqrstuvwxyz"
input = raw_input
n = int(input())

def answer(n):
    m = int(ceil(log(n*(r-1) + r, r))) - 1

    #cur = r ** (m-1)
    out = ""

    sub = (r ** m - r) // (r-1)
    n = n - sub - 1
    for i in range(m):
        i = n % r
        out = ab[i] + out
        n //= r
        #i = n // cur
        #out = out + ab[i-1]
        #n -= i * cur
        #cur //= r
    return out

#for n in range(1, 676 + 26 + 2):
if True:
    out = answer(n)
    #print(n, out)
    print(out)

Submission status: Accepted

Solution code:
a = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510,
     3817158266467286]
b = [26, 702 - 26,
     18278 - 702, 475254 - 18278,
     12356630 - 475254, 321272406 - 12356630,
     8353082582 - 321272406, 217180147158 - 8353082582,
     5646683826134 - 217180147158, 146813779479510 - 5646683826134,
     3817158266467286 - 146813779479510]
c = 'abcdefghijklmnopqrstuvwxyz'

n = int(input())
d = 0

for i in range(11):
    if n < a[i] +1:
        d = i
        break

if d == 0:
    print(c[n-1])
    exit(0)

cnt = [0] * (d+1)
n -= a[d-1] +1

for i in range(d):
    cnt[i] = n // (b[d-1 - i])
    n = n-cnt[i]*(b[d-1-i])

cnt[d] = n

for i in range(d+1):
    if i == d:
        print(c[cnt[i]])
    else:
        print(c[cnt[i]],end="")

Submission status: Accepted

Solution code:
import string


def main():
  alpha = string.ascii_lowercase

  def to_n(X, n, list_=[]):
    X_dumy = X
    while X_dumy > 0:
      list_.insert(0, X_dumy % n)
      X_dumy = int(X_dumy/n)
    return list_

  N = int(input())
  res = N
  counter = 0
  while res > 0:
    counter += 1
    res -= 26**counter

  res += 26**counter
  res -= 1
  idx = to_n(res, 26)
  # print(len(idx), counter)
  while len(idx) < counter:
    idx.insert(0, 0)
  # print(res)
  # print(idx)
  print('{:<}'.format(''.join(list(map(lambda i: alpha[i], idx)))))

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

Submission status: Accepted

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

i=0
while True:
    tmp=n % (26 ** (i+1))
    outnum.append(tmp // (26**i))
    if tmp == 0:
        tmp = 26 ** (i+1)
    n -= tmp
    if n == 0:
        break
    else:
        i += 1

outnum.reverse()
out=[]
for ou in outnum:
    out.append(alp[ou-1]) 
print("".join(out))

Submission status: Accepted

Solution code:
n=int(input())

a=n
count=0
for i in range(11):
    if a-26**(i+1)>0:
        a-=26**(i+1)
        count+=1
    else:
        break

a-=1
#print(a)
#print(count)

ans=[]
for j in range(count):
#for j in range(i+1):
    ans.append(a//26**(count-j))
    a%=26**(count-j)
ans.append(a%26)

#print(ans)
m=len(ans)
#print(m)
letter=[]
for i in range(m):
    #print(ans[i])
    if i==m-1:
        letter.append(chr(97+ans[i]))
    else:
        letter.append(chr(97+ans[i]))

print(''.join(letter))

Submission status: Accepted

Solution code:
num = int(input())
letter = ""
while num > 0:
    num, remainder = divmod(num - 1, 26)
    letter = chr(65 + remainder) + letter
print(letter.lower())

Submission status: Accepted

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

N = int(input())
count = 0
count2 = 0

al=[chr(ord('a') + i) for i in range(26)]

thresh = [26**i for i in range(1,12)]
for i in range(1,len(thresh)):
 thresh[i] = thresh[i] + thresh[i-1]
 
for i in range(len(thresh)):
    if thresh[i] <N:
        continue
    else:
        char_num = i+1#何文字
        name_str = ['a' for i in range(char_num)]
        if char_num > 1:
            count = N-thresh[i-1]#char_numの何個目か
            #print('char_num', char_num)
            for i in range(char_num):
                count2 = int((count-1)/(26**(char_num-i-1)))
                if (count2 > 0)&(i!=(char_num-1)):
                    if count2 <= 25:
                        name_str[i] = al[count2]
                        count = count - ((26**(char_num-i-1))*count2)
                    else:
                        name_str[i] = al[count2-1]
                        count = count - ((26**(char_num-i-1))*count2)
        else:
            count = N
        if count > 0:
            name_str[-1] = al[count-1]
        break
    
    
out = ""
for i in name_str:
    out = out + i
print(out)

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
chars=[chr(ord('a')+i) for i in range(26)]
ans = []
while True:
    sho = (n - 1) // 26
    amr = n % 26
    # print(sho,amr)
    ans.insert(0, chars[amr - 1])
    if sho == 0:
        break
    n = sho
print("".join(ans))

Submission status: Accepted

Solution code:
def solve():
	arr = "zabcdefghijklmnopqrstuvwxy"
	N = int(input())
	ans = ""
	power = int(26**10)
	while N > 0:
		ans = arr[N % 26] + ans
		if (N % 26 == 0):
			N = N // 26
			N -= 1
		else:
			N = N // 26
	return ans


def main():
	# for _ in range(int(input())):
	print(solve())


if __name__ == '__main__':
	main()

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)

a = int(input())

a1 = str.lower(num2alpha(a))

print(a1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
alphas = 'abcdefghijklmnopqrstuvwxyz'
alphabets = [str(alphas[i]) for i in range(26)]
ans = ''

while (N>=1):
  ans = alphabets[int((N%26)-1)]+ans
  if N%26==0:
    N = int(N/26-0.1)
  else:
    N = int(N/26)

print(ans)

Submission status: Accepted

Solution code:
import sys
import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    n = int(stdin.readline().rstrip())
    #n,k = map(int, stdin.readline().rstrip().split())
    #p = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    letter = string.ascii_lowercase
    ans = str(num2alpha(n))
    ans = ans.lower()
    print(ans)


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)

main()

Submission status: Accepted

Solution code:
N = int(input().strip())
val = ['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', 'z']
key = [i for i in range(27)]
corr_dict = {}

for key, val in zip(key, val):
  corr_dict[key] = val

ans = ''
num = N
while num > 26:
  ans += corr_dict[num%26]
  num = (num-1)//26

if num == 0:
    print(ans[::-1])
else:
    ans += corr_dict[num%26]
    print(ans[::-1])

Submission status: Accepted

Solution code:
arr = [[1, 26], [27, 702], [703, 18278], [18279, 475254], [475255, 12356630], [12356631, 321272406], [321272407, 8353082582], [8353082583, 217180147158], [217180147159, 5646683826134], [5646683826135, 146813779479510], [146813779479511, 3817158266467286]]
alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
n = int(input())

def solve(n):
    if n <= 26:
        return alphabets[n-1]
    
    x = n % 26
    if x == 0:
        return alphabets[x-1] + solve((n // 26) - 1)
    return alphabets[x-1] + solve(n // 26)

print(solve(n)[::-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()

	print(num2alpha(N).swapcase())

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)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
num = int(input())
def num_to_lett(num):
    string = ""
    while num > 0:
        num, remainder = divmod(num - 1, 26)
        string = chr(65 + remainder) + string
    return string.lower()
print(num_to_lett(num))

Submission status: Accepted

Solution code:
n = int(input())
ans = ""
c = 1
a = []
for i in range(9):
    if i == 0:a.append(26)
    else:a.append(a[i-1]+26**(i+1))
if n <= 26:
    print(chr(n+96))
else:
    while n >= 1:
        if n%26 == 0:
            ans += "z"
        else:
            ans += chr(n%26+96)
        n -= 1
        n = n//26
        c += 1
    print(ans[::-1])

Submission status: Accepted

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

while True:
    alpha = int(n % 26)
    if alpha == 0:
     result += "z"
     n -= 1
    else:
     result += chr(alpha + 96)
    if n/26 < 1:
        break
    n /= 26
rslt = result[::-1]
print(rslt)

Submission status: Accepted

Solution code:
n=int(input())
res=""
l=[chr(i) for i in range(97,123)]
while(n>0):
    x=n%26
    if x==0:
        res+="z"
        n=n//26-1
    else:
        res+=l[x-1]
        n=n//26
print(res[::-1])

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
ch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]

ans = ""
while n>0:
    if n%26: ans = ch[n%26] + ans; n //= 26
    else: ans = ch[n%26] + ans; n //= 26; n -= 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
namelist = []
num2alpha = lambda c: chr(c+64)
for i in range(20):
    if N <= 26:
        namelist.append(num2alpha(N))
        break
    
    if  N % 26 == 0:
        namelist.append('z')
        N = (N//26)-1
    else:
        mod = N%26
        namelist.append(num2alpha(mod))
        N = (N//26)
    
while '' in namelist:
    namelist.remove('')
namelist.reverse()
ans = ''.join(namelist)

print(ans.lower())

Submission status: Accepted

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

l = [26]
for i in range(2, 14):
    a = 26 ** (i) + l[i-2]
    l.append(a)

idx = 0
while True:
    if n <= l[idx]:
        break
    idx += 1

if idx == 0:
    print(s[n-1])
    exit()

q = n - l[idx-1] - 1

ll = []
for j in range(idx+1):
    q, mod = divmod(q, 26)
    ll.append(mod)

ll.reverse()
ans = ""
for e in ll:
    ans += s[e]

print(ans)

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
stack = deque()
ans =[]
while n > 0:
    if 1<= n <= 26:
        stack.append(n)
        break
    mod = n%26
    if mod == 0:
        mod = 26
    stack.append(mod)
    if mod == 26:
        n = (n//26) - 1
    else:
        n = n//26
while stack:
    tmp = stack.pop()
    alp = chr(tmp+96)
    ans.append(alp)
anss = ''.join(ans)
print(anss)

Submission status: Accepted

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

one = False
while n > 0:
    mod_c = (n-1) % 26
    chr_n = (mod_c + 97)
    str = chr(chr_n) + str
    n = n-mod_c+1
    if n == 26:
        break
    n = int(n / 26)

print(str)

Submission status: Accepted

Solution code:
a=int(input())
s=0
d=1
si=[]
while a>0:
    b=a%26
    si.append(b)
    a=a//26
    if b==0:
      a-=1
    
    
 
c=""
for i in si:
  if i==0:
    i=26
  c+=chr(i+96)
c=c[::-1]
print(c)

Submission status: Accepted

Solution code:
N = int(input())
a = 26
counter = 1
while a<N:
  N -= a
  counter += 1
  a *= 26
ans = []
N -= 1
while N>=26:
  ans.append(N%26)
  N = N //26
ans.append(N)
dic = ["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 = [dic[i] for i in ans[::-1]]
n = len(ans)
print("a"*(counter-n) + "".join(ans))

Submission status: Accepted

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

abc=[chr(i) for i in range(97,123)]

N=int(input())

#for n in range(1,100):
#N=n
ans=""

L=0
for i in range(1,12):
    if N >= 26**i:
        N-=26**i
    else:
        L=i
        break
#print(L,N)

if N==0:
    for i in range(L-1):
        ans+="z"
else:
    for i in range(L,1,-1):
        if N <= 26**(i-1):
            ans+="a"
        else:        
            for j in range(1,26):
                if 26**(i-1)*j < N and 26**(i-1)*(j+1) >= N:
                    ans+=abc[j]
                    N-=26**(i-1)*j
                    break
    ans+=abc[N-1]
print(ans)

"""
re=0
L=len(ans)
for i in range(L):
    ind=abc.index(ans[L-i-1])+1
    re+=ind*26**i

print(re)

if n!=re:
    print(n)
    break
"""

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

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

def main():
    n = int(input())
    s = []
    while n!=0:
        if n<=26:
            s.append(n)
            n = 0
        else:
            x = n % 26
            if x==0:
                x = 26
            s.append(x)
            n = (n-1) // 26
    t = []
    for i in range(len(s)-1,-1,-1):
        t.append(chr(s[i]+96))
    print(''.join(t))
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

ans = ""

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

while n > 0:
    tmp = n % 26
    if tmp > 0:
        ans += al[tmp-1]
    else:
        ans += 'z'
        n = n - 1
    n = n // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

keta = 1
for i in range(1, 18):
    t = 26*(26**i-1)//25
    if n <= t:
        break
    else:
        keta += 1

n -= 26*(26**(keta-1)-1)//25
n -= 1

ans = ""
for i in range(keta):
    t = 26**i
    ans = chr(ord('a')+(n//t)%26)+ans
print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(input().strip())
 
    chars = "abcdefghijklmnopqrstuvwxyz"
    ans = []
 
    while True:
        if n < 27:
            ans.append(chars[n - 1])
            break
 
        else:
            remainder = int(n % 26)
            n = int(n / 26)
            if remainder > 0:
                ans.append(chars[remainder - 1])
            else:
                ans.append(chars[-1])
                n -= 1
 
        
    print("".join(ans[::-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(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)])

print(alphabet_decimal(N).lower())

Submission status: Accepted

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

print(num2alpha(N).lower())

Submission status: Accepted

Solution code:
N = int(input())
ABC = ["a", "b", "c", "d", "e", "f","g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ]
count = []
i = 1
keta = 0
while True:
    if N< 26*(26**i-1)/25:
        keta = i
        break
    else:
        i+=1
n = keta-1
bann = N-26*(26**n-1)/25
#print(keta, bann)
if bann ==0:
    ans2 = []
    for i in range(keta-1):
        ans2.append("z")
    print("".join(ans2))
    
    
else:
    
    bann-=1
    ans1 = []
    while True:
        a = bann//26
        b = bann % 26
        ans1.append(b)
        #print(a)
        if a<26:
            if a!=0:
                ans1.append(a)
            break

        bann=a
    #print(ans1)
    while len(ans1)<keta:
        ans1.append(0)
    ans2 = []
    #print(ans1)
    for i in reversed(ans1):
        ans2.append(ABC[int(i)])
    print("".join(ans2))

Submission status: Accepted

Solution code:
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 convertList(lst):
    rev_lst = list(reversed(lst))
    for i,num in enumerate(rev_lst):
        if i < len(rev_lst)-1:
            if num <= 0:
                rev_lst[i+1] = rev_lst[i+1]-1
                rev_lst[i] = rev_lst[i] + 26
    return list(reversed(rev_lst))

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

N = input()
N = list(map(int,[i for i in N]))
lst = base_convert(N,10,26)
lst_converted = convertList(lst)
ans = ''.join([dict1[i] for i in lst_converted])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

name_len = [0]
while True:
  name_len.append(name_len[-1]+26**(len(name_len)))
  if name_len[-1] > 1000000000000001:
    break

#print(name_len) 

number = 0
for i in range(len(name_len)):
  if name_len[i] < n and n <= name_len[i+1]:
    number = i+1
    break

#print(number)
#print(n)
n -= name_len[number-1]
#print(n)

ans = ""
li = ['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']
#print(len(li))

for i in range(number,0,-1):
  #print(i,n)
  #print(int(n/26**(i-1)))
  #print(li[25])
  if i == 1:
    ans += li[int(n / 26**(i-1))-1]
  else:
    if n%26**(i-1) == 0:
      ans += li[int(n / 26**(i-1))-1]
    else:
      ans += li[int(n / 26**(i-1))]
  n = n% 26**(i-1)

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)
      
ans=num2alpha(N)

print(ans.lower())

Submission status: Accepted

Solution code:
n = int(input())
s = ""
a = "zabcdefghijklmnopqrstuvwxyz"
while n > 0:
    k = n % 26
    s += a[k]
    n //= 26
    if k == 0:
        n -= 1
print(s[::-1])

Submission status: Accepted

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

num = []
while True:
    sho = n // 26
    amari = n % 26
    if amari == 0:
        amari = 26
        sho = n // 26 - 1

    num.append(amari)
    if sho == 0:
        break
    n = sho

num.reverse()

ans = ''
for i in num:
    ans += chr(i - 1 + ord('a'))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a = int(input())
    ans = num2alpha(a)
    print(ans)

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)
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def moji(x):
    return chr(x + 96)

n = int(input())
s = ""

cnt = 0
a = 26
i = 1

while(1):
    if n <= a:
        cnt = i
        break
    i += 1
    a = 26 ** i + a



for i in range(1, cnt+1):
    if i != 1:
        n = n - (26**(i-1))
    if i == 1:
        k = n % 26
        if k == 0:
            k = 26
        s += moji(k)
    else:
        if n %  (26 ** (i-1)) == 0:
            k = (n // (26 ** (i-1))) % 26
        else:
            k = (n // (26 ** (i-1))) % 26 + 1
        if k == 0:
            k = 26
        s += moji(k)

print(s[::-1])

Submission status: Accepted

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

s = 0
while 1:
    if s == 1 and n < 1:
        break
    s = 1
    if n%26 == 0:
        ans.append(0)
    else:
        ans.append(n%26)
    n -= n%26
    n = n//26
for i in range(len(ans)):
    if i != len(ans)-1:
        if ans[i] <= 0:
            ans[i+1] -= 1
            ans[i] += 26
    else:
        if ans[i] <= 0:
            del ans[i]
ans = ans[::-1]
for i in range(len(ans)):
    print(chr(96+ans[i]),end="")
print("")

Submission status: Accepted

Solution code:
n = int(input())
data = [26 ** x for x in range(1, 12)]

d = 0
r = 0
for i in range(len(data)):
    if n <= d + data[i]:
        r = i+1
        n -= (d + 1)
        break
    
    d += data[i]

kurai = [26 **  x for x in range(r)][::-1]
ans = [0] * r
for i in range(r):
    ans[i]= min(n // kurai[i], 25)
    n -= kurai[i] * ans[i]

alpha = [chr(i) for i in range(97, 97+26)] 
ans = [alpha[a] for a in ans]
print("".join(ans))

Submission status: Accepted

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

if N <= 26:
    M00 = [N]
else:
    l = 1
    M = N
    M0 = []
    while(M>0):
        M -= 26**l
        M0.append(M)
        l+=1

    MM = M0[l-3]-1
#    print(MM)
    cnt = l-1
#    print(cnt)
    M00 = []
    while(cnt>=1):
        #    print(cnt)
        a = math.floor(MM/26**(cnt-1))
        M00.append(a+1)
        MM -= a*26**(cnt-1)
        #    print(MM)
        cnt -= 1
    
#print(MM)
str0 = []
for i in range(len(M00)):
    str0.append(chr(M00[i]+96))
    
print(''.join(str0))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = int(input())
    list=[]
    b=0
    for i in range(11):
        b+=26**(i+1)
        list.append(b)

    count = 0
    for i in range(11):
        if a <= list[i]:
            count = i+1
            break
    ans=""
    for i in range(count):
        c = a % 26
        a = a // 26
        if c == 0:
            c=26
            a-=1
        ans= chr(96 + c) +ans

        if a == 0:
            break

    print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

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

ans=''
for i in range(len(rest)):
    ans+=alphabet[rest[i]]
print(ans)

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())
#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]
print(num2alpha(N))

Submission status: Accepted

Solution code:
alphabet='abcdefghijklmnopqrstuvwxyz'
N=int(input())
r=[]
while N>26:    
  x=N%26
  N=N//26
  if x==0:
    N-=1
    x=26
  r.append(x)
r.append(N)
name=[alphabet[i-1] for i in r]
name.reverse()
name=''.join(name)
print(name)

Submission status: Accepted

Solution code:
s=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(s).lower())

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    chars = "abcdefghijklmnopqrstuvwxyz"
    res = ""

    for i in range(1, 100):
        x = n % 26
        if x == 0:
            x = 26
        res += chars[x - 1]
        n -= x
        n //= 26
        if n == 0:
            break

    print(res[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
def dal_name(N):
    dal = ""
    while N > 0:
        N, remainder = divmod(N - 1, 26)
        dal = chr(97 + remainder) + dal
    return dal

print(dal_name(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python program to find Excel column name from a  
# given column number 
  
MAX = 50
  
# Function to print Excel column name  
# for a given column number 
def printString(n): 
  
    # To store result (Excel column name) 
    string = [" "] * MAX
  
    # 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: 
            string[i] = 'Z'
            i += 1
            n = (n // 26) - 1
        else: 
            string[i] = chr((rem - 1) + ord('a')) 
            i += 1
            n = n // 26
    string[i] = ' '
  
    # Reverse the string and print result 
    string = string[::-1] 
    return(string)

T = printString(int(input()))
V = [t.lower() for t in T if t != " "]
print("".join(V))

Submission status: Accepted

Solution code:
n = int(input())


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


print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
N = int(input())
b = 96
ans = ""
while N > 0:
  r = N % 26
  if r == 0:
    ans = "z" + ans
  else:
    ans = chr(b + r) + ans
  if N % 26 == 0:
    N = N // 26  -1
  else:
    N = N // 26
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s='zabcdefghijklmnopqrstuvwxy'

answer = []
i = 1
while n > 0:
  x = n % 26
  if x >0:
  	n = n // 26
  else:
    n = n // 26 -1
  answer.append(s[x])
print(''.join(answer[::-1]))

Submission status: Accepted

Solution code:
N = int(input())

result = ''
ALPHABET = 'zabcdefghijklmnopqrstuvwxy'

while N > 0:
    N, n = divmod(N, 26)
    result = ALPHABET[n] + result
    if n == 0:
        N -= 1

print(result)