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: Runtime Error

Solution code:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

#26**11
num = int(input())
num = str(Base_10_to_n(num,26))
d = {"a":1,"b":2,"c":3,"d":4,"e":5,"f":6,"g":7,"h":8,"i":9,"j":10,"k":11,"l":12,"m":13,"n":14,"o":15,"p":16,"q":17,"r":18,"s":19,"t":20,"u":21,"v":22,"w":23,"x":24,"y":25,"z":26}
op_d = {}
for i,j in d.items():
    op_d[j] = i
ans = ""
for i in num:
    ans += op_d[int(i)]
print(ans)

'''
ans =""

for i in list(range(0,11))[::-1]:
    if(num//(26**i) == 0 ):
        pass
    else:
        ans += op_d[num//26**i]
        num = num % 26**i;
print(ans)
'''

Submission status: Runtime Error

Solution code:
n=int(input())

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

if n<27:
    print(alphabet[n])
    exit()
    
rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

if rest[-1]==0:
    for i in range(len(rest)-1):
        rest[i]=26
    rest.pop(-1)

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

Submission status: Runtime Error

Solution code:
n = int(input())
NUM = []
while n != 0:
    NUM.append(n % 26)
    n = n // 26
NUM.reverse()

dict = {
    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",
}

ANS = []
for i in NUM:
    ANS.append(dict[i])
print(''.join(ANS))

Submission status: Runtime Error

Solution code:
N = int(input())
n = [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]
if N <= 26:
  print(n[N-1])
if 26 < N <= 702:
  NN = N - 26
  Na = NN // 26
  Nb = NN % 26
  print(n[Na-1]) + print(n[Nb-1])
if 702 < N <= 17576

if 17576 < N <= 456976

if 456976 < N <=

Submission status: Runtime Error

Solution code:
import copy
n = int(input())
max_n = 1000000000000001
s = 26
for i in range(100):
    max_n //= s
    if max_n == 0:
        break
# print(i)
# 10
tmp = copy.copy(n)
bs = [(26**i, i) for i in range(1,11)]
# print(bs)
cur = 0
while tmp >= 0:
    tmp -= bs[cur][0]
    dim = bs[cur][1]
    cur += 1

tmp += bs[dim-1][0]
# print(tmp, dim)
tmp = copy.copy(n)
def temp_replace(num, dim):
    global tmp
    num //=26
    a = tmp // num
    tmp -= num * a
    # print('deb', dim, num, a, tmp)
    return a
mm = [temp_replace(num, dim) for num, dim in list(reversed(bs))[-dim:]]
# print(mm[-dim:])

cs = list("abcdefghijklmnopqrstuvwxyz")

#  print(len(cs))
print("".join([cs[mi-1] for mi in mm]))

Submission status: Runtime Error

Solution code:
n = input()

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


print(num2alpha(n))

Submission status: Runtime Error

Solution code:
n=int(input())
 
#11桁で足りる
 
alp=[chr(ord('a') + i) for i in range(26)]
lst=[0]*11
 
for i in range(11):
    if n>=26**(10-i):
        a,n=divmod(n,26**(10-i))
        lst[i]=alp[a-1]
 
switch=0
for i in range(10):
    if lst[i]==0:
        if switch==0:
            lst.remove(0)
        else:
            lst[i]="a"
    else:
        switch=1
 
print("".join(lst))

Submission status: Runtime Error

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:
        out.append(X_dumy%n)
        X_dumy = int(X_dumy/n)
    return out
out = Base_10_to_n(x, 26).reverse()
print( "".join(alphbet(i) for i in out) )

Submission status: Runtime Error

Solution code:
import string

def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]

letters = {}
for x, y in zip(range(1, 27), string.ascii_lowercase):
    letters[x] = y

def toLetter(x):
    return letters[x]

n = int(input())

print(''.join(list(map(toLetter, numberToBase(n, 26)))))

Submission status: Runtime Error

Solution code:
n=int(input())-1
j=26
while j<=n:
  n-=j
  j*=26
j/=26
ret = ""
while j:
  ret += "abcdefghijklmnopqrstuvwxyz"[n//j]
  n %= j
  j /= 26
print(ret)

Submission status: Runtime Error

Solution code:
n = int(input())
s=[]
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"]
word = []
while n > 0:
    s.append(n % 26)
    n = n // 26
for m in s:
    if m == 0:
        word.append(z)
    else:
        word.append(alp[m-1])
word.reverse()
print("".join(word))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
A=list('abcdefghijklmnopqrstuvwxyz')
n = int(float(str(math.log(N,26))[0]))
Ans = ''
while n >= 0 :
    v = N//(26**n)
    Ans += A[v - 1]
    N -=  (26**n)*v
    n -= 1
print(Ans)

Submission status: Runtime Error

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

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
tmp = [26, 676, 17576, 456976, 11881376, 308915776, 8031810176, 208827064576, 5429503678976, 141167095653376]

for i in range(len(tmp)):
    if(n <= tmp[i]):
        n_pow = i
        break

answer = ''
n_tmp = n
if(n_pow > 0):
    for n_p in range(n_pow):
        p = (n_pow - n_p) - 1
        temp = int(n_tmp / tmp[p])
        answer += ascii_lowercase[temp - 1]
        n_tmp -= temp * tmp[p]
    answer += ascii_lowercase[n_tmp - 1]
else:
    answer += ascii_lowercase[n_tmp - 1]

print(answer)

Submission status: Runtime Error

Solution code:
n = int(input())
a = 26
c = 1
res =""
t = ""
n2 = n

num2alpha = lambda c: chr(c+64)

while True:
    if n % 26 == 0:
        t = num2alpha(int(n % a))
    else:
        t = num2alpha(int(n % 26))
        n = n / 26

    if t == "@":
        t = "z"
    res = t + res
    if n2 <= a:
        break
    c += 1
    a = a + (26**c)

print(str.lower(res))

Submission status: Runtime Error

Solution code:
import string
import numpy as np

low = string.ascii_lowercase
base26 = "123456789ABCDEFGHIJKLNMOP0"
N = int(input())
x = np.base_repr(N, 26)

ans = ""
for i,v in enumerate(reversed(x)):
    ans = low[base26.index(v)] +ans
    if v=="0" and i != 0:
        x[i-1] -=1

print(ans)

Submission status: Runtime Error

Solution code:
L=[26**i for i in range(12)]
#print(L)
gun=[sum(L[1:i])for i in range(2,12)]
#print(gun)
N=int(input())
i=0
while N > gun[i]:
  i += 1
#print(i)
if i != 0:
  N = N - gun[i-1] #これを26進法
N -= 1
#print(N)
L=[]
for k in range(1,i+2):
   L.append(N//(26**(i+1-k)))
   N = N % (26**(i+1-k))
#print(L)
L=[chr(i+97) for i in L]
#print(L)
print(''.join(L))

Submission status: Runtime Error

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)

return num2alpha(N)

Submission status: Runtime Error

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)
#print(ans)
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: Runtime Error

Solution code:

n=int(input())

a="abcdefghijklmnopqrstuvwxyz"
aa=list(a)

stra=""
kk=n
for i in range(15):
    ki=kk%26
    if ki!=0:
        stra=aa[ki-1]+stra    
    else:
        stra=aa[26]+stra    
    kk=(kk-ki)//26
#    print(kk,ki,stra)
    if kk==0:
        break
    
print(stra)

Submission status: Runtime Error

Solution code:
n = int(input())

d5 = int(float(n)/(26 ** 4))
d4 = int(float(n-(d5* 26 ** 4)) / (26 ** 3))
d3 = int(float(n-(d4* 26 ** 3) - (d5* 26 ** 4)) / (26 ** 2))
d2 = int(float(n-(d4* 26 ** 3) - (d5* 26 ** 4) - (d3* 26 ** 2)) / 26)
d1 = int(float(n-(d4* 26 ** 3) - (d5* 26 ** 4) - (d3* 26 ** 2)) - (d2 * 26))

m1 = chr(96+d1)
m2 = chr(96+d2)
m3 = chr(96+d3)
m4 = chr(96+d4) 
m5 = chr(96+d5) 

if ord(m1) == 0x60:
    m1 = ''
if ord(m2) == 0x60:
    m2 = ''
if ord(m3) == 0x60:
    m3 = ''
if ord(m4) == 0x60:
    m4 = ''
if ord(m5) == 0x60:
    m5 = ''

ans = m5 + m4 + m3 + m2 + m1

print (ans)

Submission status: Runtime Error

Solution code:
n=int(input())

#11桁で足りる

alp=[chr(ord('a') + i) for i in range(26)]
lst=[0]*11

for i in range(11):
    if n>=26**(10-i):
        a,n=divmod(n,26**(10-i))
        lst[i]=alp[a]

switch=0
for i in range(10):
    if lst[i]==0:
        if switch==0:
            lst.remove(0)
        else:
            lst[i]="a"
    else:
        switch=1

print("".join(lst))

Submission status: Runtime Error

Solution code:

import string
import numpy as np

low = string.ascii_lowercase
base26 = "123456789ABCDEFGHIJKLNMOP0"
N = int(input())
x = np.base_repr(N, 26)
print(x)

ans = ""
for i,v in enumerate(reversed(x)):
    ans = low[base26.index(v)] +ans
    if v=="0" and i != 0:
        x[i-1] -=1

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
#n = 703
strList = [chr(ord('a') + i) for i in range(26)]
surplusList = []
while n > 26:
    surplusList.append(n%26)
    n = n/26
surplusList.append(n)
surplusList.reverse()
name = ''
for i in range(len(surplusList)):
    name = name + strList[surplusList[i]-1]
print(name)

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())
alphabet = [chr(ord('a') + i) for i in range(26)]
num2alphabet = {i + 1: a for i, a in enumerate(alphabet)}

ans = ""

while N > 0:
    num = N % 26
    ans += num2alphabet[num]
    N = N // 26

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

Submission status: Runtime Error

Solution code:
N = int(input())

ch = ['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']


# def Base_10_to_n(X, n):
#     X_dumy = X
#     out = ''
#     while X_dumy > 0:
#         out = ch[X_dumy % n - 1] + out
#         X_dumy = int(X_dumy / n)
#     return out


# print(Base_10_to_n(N, 26))

keta = 0
max = 0
while max < N:
    keta += 1
    max += 26 ** keta

res = ""
while keta > 0:
    res += ch[N // (26 ** (keta - 1)) - 1]
    N = N - (26 ** (keta - 1))
    keta -= 1
print(res)

Submission status: Runtime Error

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

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

N=int(input())

ans=""

L=0
for i in range(1,12):
    if N > 26**i:
        N-=26**i
    else:
        L=i
        break
#print(L,N)
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
#print(L,N)
ans+=abc[N-1]
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
h = []
na = ["a","b", "c", "d", "e", "f", "g",
        "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
        "r", "s", "t", "u", "v", "w", "x", "y", "z"]
name = ""

if n < 26:
    h.append(n)
else:
    while n >= 27:
        tmp = n%26
        n //= 26
        h.append(tmp)
        print(n)

    print(n)
    if n != 0:
        h.append(n)

h = h[::-1]
if h[-1] == 0:
    h.pop(-1)
    for i in h:
        name += na[-i]
else:
    for i in h:
        name += na[-i-1]

print(name)

Submission status: Runtime Error

Solution code:
import itertools
import math
N = int(input())
alphabet = list('abcdefghijklmnopqrstuvwxyz')
num = math.ceil(math.log(N, 26))
cnt = [26**i for i in range(1, 15)]
cumsum = list(itertools.accumulate(cnt))
if num == 1:
    ans_n = N-1
    ans_li = list(itertools.product(alphabet, repeat=num))
    print(''.join(ans_li[ans_n]))
else:
    ans = ''
    # for i in range(num):
    #     if i == 1:
    #         ans_n = N-1
    #         ans_li = list(itertools.product(alphabet, repeat=num))
    #         ans += ans_li[ans_n]
    #     else:
    #         now_n = N-26**(i-1) - 1
    #         pre = 26**(i-1)
    #         tmp = ans_n//pre

    ans_n = N - cumsum[num-1] - 1
    pre = 26**(num-1)
    tmp = ans_n//pre
    ans = alphabet[tmp]
    final = ans_n - pre*tmp
    ans_li = list(itertools.product(alphabet, repeat=num-1))
    print(ans + ''.join(ans_li[final]))

Submission status: Runtime Error

Solution code:
import string

N = int(input())
alphabet = [chr(ord('a') + i) for i in range(26)]
num2alphabet = {i + 1: a for i, a in enumerate(alphabet)}

ans = ""

while N > 0:
    num = N % 26
    ans += num2alphabet[num]
    N = N // 26

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

Submission status: Runtime Error

Solution code:
N = int(input())

num=0
for index, item in enumerate(list(N)):
	num += pow(26,len(N)-index-1)*(ord(item)-ord('A')+1)


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)

Submission status: Runtime Error

Solution code:
import string

N = int(input())
alphabet = list(string.ascii_lowercase)
num2alphabet = {i + 1: a for i, a in enumerate(alphabet)}

ans = ""

while N > 0:
    num = N % 26
    ans += num2alphabet[num]
    N = N // 26

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

Submission status: Runtime Error

Solution code:
N = int(input())

ch = ['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']


# def Base_10_to_n(X, n):
#     X_dumy = X
#     out = ''
#     while X_dumy > 0:
#         out = ch[X_dumy % n - 1] + out
#         X_dumy = int(X_dumy / n)
#     return out


# print(Base_10_to_n(N, 26))

keta = 0
max = 0
while max < N:
    keta += 1
    max += 26 ** keta

res = ""

while keta > 0:
    res += (ch[N // (26 ** (keta - 1)) - 1])
    N = N - (26 ** (keta - 1))
    keta -= 1

print(res)

Submission status: Runtime Error

Solution code:
n=int(input())

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

if n<27:
    print(alphabet[n])
    exit()
rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
import string
import itertools

request_number = int(input())

def append_alfabet(str=''):
    return list(map(lambda s: f'{str}{s}', string.ascii_lowercase))

names = append_alfabet()

for i in range(3):
    alfabets_2d = list(map(append_alfabet, names))
    alfabets_flat = list(itertools.chain.from_iterable(tmp))
    names = names + alfabets_flat

print(names[request_number-1])

Submission status: Runtime Error

Solution code:
maps = {'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 = int(input())
s=''
while True:
  s = maps[str(n%26)] + s
  n //= 26
  if n == 0:
    break
print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
a=N//27
b=N%27
j=0
p=N
for i in range(1,11):
  if N<pow(26,i):
    j=i-1
    break
  p-=pow(26,i)
s=''
if j==0:
  print(chr(N+96))
else:
  q=N
  for i in range(j):
    q-=pow(26,i+1)
  q-=1
  for k in range(j,-1,-1):
    s=s+chr(q//pow(26,k)+97)
    q-=(q//pow(26,k))*pow(26,k)
  print(s)

Submission status: Runtime Error

Solution code:
def main():
    #input
    N=int(input())
    l=list("zabcdefghijklmnopqrstuvwxy")

    name=[]
    n=N
    while n>26:
        mod=n%26
        n//=26
        name.append(l[mod])
    name.append(l[n])
    name=[name[n] for n in reversed(range(len(name)))]
    print("".join(name))

if __name__=="__main__":
    main()

Submission status: Runtime Error

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

print(''.join(name))

Submission status: Runtime Error

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 = ""
    for i in range(m):
        i = n // cur
        out = out + ab[i-1]
        n -= i * cur
        cur //= r
    return out

out = answer(n)
print(out)

Submission status: Runtime Error

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 -= 1
    n /= 26
    if n == 0:
        break

print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
x = 1
alphabet = {i-96:chr(i) for i in range(97, 97+26)}
if int(N) > 26:
    ans = ''
    while x != 0:
        x = N // 26
        mod = N%26
        #print(x, mod, alphabet[mod])
        ans += alphabet[mod]
        N = x
else:
    ans = alphabet[int(N)]
print(ans[::-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
alphabet="abcdefghijklmnopqrstuvwxyz"
l=[]
a=1
sm=0
for i in range(15):
    a*=26
    sm+=a
    l.append(sm)

for i in range(len(l)):
    if n<=l[i]:
        cl=i
        break

if cl==0:
    print(alphabet[n-1])
    sys.exit()
ans=""
n-=l[cl-1]

for i in range(cl):
    num=n//(26**(cl-i))
    if num%(26**(cl-i))!=0:
        ans=ans+alphabet[num]
    else:
        ans=ans+"z"
    n-=((26**(cl-i))*num)

if n!=0:
    ans=ans+alphabet[n-1]
else:
    ans=ans+"z"
print(ans)

Submission status: Runtime Error

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


def calc(x, i):
  target = x - 26 ** i
  if (target < 0):
    return (x, i)
  else:
    return calc(target, i + 1)


def base10to(n, b):
  if(int(n/b)):
    return base10to(int(n/b), b) + str(n % b)
  return str(n % b)


target, index = calc(n, 1)
base26 = str(int(base10to(target, 26)) - 1)
ans = ''
head = index - len(base26)
for a in range(head):
  ans += 'a'
for c in base26:
    ans += s[int(c)]
print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import string
import itertools

request_number = int(input())

def append_alfabet(str=''):
    return list(map(lambda s: f'{str}{s}', string.ascii_lowercase))

names = [''] + append_alfabet()

for i in range(3):
    alfabets_2d = list(map(append_alfabet, names))
    alfabets_flat = list(itertools.chain.from_iterable(tmp))
    names + alfabets_flat

print(names[request_number])

Submission status: Runtime Error

Solution code:
import sys
from io import StringIO
import unittest
import math

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

    alphabets = [chr(ord('a') + x) for x in range(26)]

    ans = []
    h = 0
    tmp = 0

    while 1:
        tmp += 26 ** h
        if n >= tmp:
            h += 1
        else:
            break

    for hh in range(h - 1, -1, -1):
        tmp = n // (26 ** hh)
        ans.append(alphabets[tmp - 1])
        n -= tmp * (26 ** hh)

    print(''.join(ans))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2"""
        output = """b"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """27"""
        output = """aa"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """123456789"""
        output = """jjddja"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
while(n<26):
  x = n%26;
  l.append(x)
  n = n/26
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']
for i in reversed(l):
  s = s + a[i-1]
print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
s=[]
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"]
word = []
while n > 0:
    s.append(n % 26)
    n = n // 26
for  m in s:
    if m == 0:
        word.append(z)
    else:
        word.append(alp[m-1])
word.reverse()
print("".join(word))

Submission status: Runtime Error

Solution code:
n = int(input())
w_dict = {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"}
out = ""
while n > 26:
    out = out + w_dict[n % 26]
    n = n // 26

out = out + w_dict[n]
print(out[::-1])

Submission status: Runtime Error

Solution code:
n = int(input())
a = [0] * 12
for i in range(11,0,-1):
    m = n // 26 ** i
    a[i] = m
    n -= m * (26 ** i)
a[0] = n
for i in range(11, - 1, - 1):
    if a[i] == 0:
        a.pop(i)
    else:
        break
b = "abcdefghijklmnopqrstuvwxyz"
c = []
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 26
        a[i + 1] -= 1
    c.append(b[a[i] - 1])
c.reverse()
print(*c, sep="")

Submission status: Runtime Error

Solution code:
import math as mt
import collections as cc
I=lambda:list(map(int,input().split()))
ans=[]
prev=0
for i in range(1,15):
    ans.append(26**i+prev)
    prev+=26**i
    
n,=I()
p=0
s='abcdefghijklmnopqrstuvwxyz'
f={}
for i in range(1,27):
    f[i]=s[i-1]
for i in range(len(ans)):
    p+=1
    if n<=ans[i]:
        break
an=''
for i in range(p):
    an+=f[n%26]
    n//=26
print(an)

Submission status: Runtime Error

Solution code:
maps = {'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 = int(input())
s=''
while True:
  s = maps[str(n%26)] + s
  n //= 26
  if n < 26:
    break
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
alpha = [chr(i) for i in range(97, 123)]
name = []
if N <= 26 ** 1:
    for i in range(26):
        name.append(alpha[i])
if N <= 26 ** 2 + 26 ** 1:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
if N <= 26 ** 3 + 26 ** 2:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
if N <= 26 ** 4 + 26 ** 3:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
if N <= 26 ** 5 + 26 ** 4:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
if N <= 26 ** 6 + 26 ** 5:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
if N <= 26 ** 7 + 26 ** 6:
    for i in range(26):
        name.append(alpha[i] + alpha[i])
print(name[N - 1])

Submission status: Runtime Error

Solution code:
# coding: utf-8
import string
import itertools

request_number = int(input())

def append_alfabet(str=''):
    return list(map(lambda s: f'{str}{s}', string.ascii_lowercase))

names = append_alfabet()

for i in range(3):
    alfabets_2d = list(map(append_alfabet, names))
    alfabets_flat = list(itertools.chain.from_iterable(tmp))
    names + alfabets_flat

print(names[request_number])

Submission status: Runtime Error

Solution code:
n = int(input())

ans = ""

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

print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
n = N
alp = 'zabcdefghijklmnopqrstuvwxy'
record = []
while n / 26 > 1:
    record.append(n%26)
    n = n // 26

if record[-1] == 0:
    record.append((n-1)%26)
else:
    record.append(n%26)
rec = ''.join([alp[record[r]] for r in range(len(record)-1, -1, -1)])
print(rec)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    res = ''
    d = 1
    base = []
    alp = 'abcdefghijklmnopqrstuvwxyz'
    for i in range(12):
        d *= 26
        base.append(d)
    for b in base:
        if b > n:
            break
        mod = n % b
        n = n - mod
        res = alp[mod-1] + res
    print(res)




if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = [26**i for i in range(1,30)]
A = [0]+list(itertools.accumulate(A))
cnt = 0
for i in range(N):
    if A[i] >= N:
        p = cnt
        break
    cnt += 1
if p == 1:
    print(chr(N+96))
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p-1):
    s.append(chr(N%26+96))
    N = N//26
s.append(chr(N+96))
s.reverse()
print(''.join(s))

Submission status: Runtime Error

Solution code:
n=int(input())

def change(): #ここに数字からアルファベットを1体1で対応させれば終わり

p=[]
while n>0:
  a=n%26
  p.append(a)
  n=n//26

for i in range(len(p)):
  p[i]=change(p[i])

p.reverse()  

b=''

for i in range(len(p)):
  b += p[i]
  
print(b)

Submission status: Runtime Error

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N = INT()
K = N

i = 1
while K > 26**i:
	K -= 26**i
	i += 1

ans = ""
for j in range(i-1, -1, -1):
	ans += ascii_lowercase[N//26**j-1]
	N %= 26**j

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=""
while n>26:
    rem=n%26
    if rem==0:
        ans+="z"
        n=(n//26-26)*26
        continue
    n//=26
    ans+=chr(rem+96)
ans+=chr(n+96)
print(ans[::-1])

Submission status: Runtime Error

Solution code:
n=int(input())
m=n
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']
for i in range(1,11):
  n-=26**i
  if n<=0:
    count=i
    break
n=m

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

B=[]
for i in range(count-1,0,-1):
  B.append(n//(26**i))
  n-=(n//(26**i))*(26**i)
B.append(n)

C=[]
for i in B:
  C.append(A[i])
print(''.join(C))

Submission status: Runtime Error

Solution code:
def A(x):
  if ord(x) - ord('a') >= 0:
    print('a')
  else:
    print('A')


def B(n, k, p_list):
  p_list = sorted(p_list)
  print(sum(p_list[:k]))


def _get_base_x(n, x):
  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'
  ]
  b = []
  while True:
    s = n // x
    y = n % x
    b = b + [y]
    if s == 0:
      break
    n = s
  b.reverse()
  ret = []
  for i in b:
    ret.append(a[i - 1])
  print(''.join(ret))


def C(x):
  _get_base_x(x, 26)


def main():
  # letter = input()
  # A(letter)
  # for x in ['A', 'Z', 'a', 'z']:
  #   A(x)

  # n, k = map(int, input().split())
  # p_list = map(int, input().split())
  # B(n, k, p_list)
  C(long(input()))
  # num = 1
  # for i in range(50):
  #   print(str(num))
  #   # C(int(str(num)))
  #   num = num * 26 + 1


if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
BC=[]
for i in range(Q):
    BC.append(list(map(int,input().split())))
for i in BC:
    if i[0] in A:
        indexlist=my_index_multi(A,i[0])
        for j in indexlist:
            A[j]=i[1]
    print(sum(A))

Submission status: Runtime Error

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"*(conter-n) + "".join(ans))