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:
n=int(input())

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

ans=0
x=0
while n>ans:
    x+=1 #文字数
    ans+=26**x

ANS=[0]*x
#print(ANS)
c=0
N=n
i=1
y=0
if n<=26:
    ANS[0]=alpha[n%26]
else:
    ANS[0]=alpha[n%26]
    y=n
    while y>=1 and i<=x-1:
        if y%26==0 and y/26<26:
            y=y/26
            ANS[i]=alpha[y]
            i+=1
        elif y%26==0:
            y=y//26
            ANS[i]=alpha[0]
            i+=1
        else:
            y=y//26
            c=y%26
            ANS[i]=alpha[c]
            i+=1
ANS.reverse()
AA=''.join(ANS)
print(AA)

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(map(int, input().split()))
q = int(input())

table = [0] * 100010


for i in A:
  table[i] += 1

  sum = 0

  for i in A:
    sum += i

    for i in range(q):
      b, c = map(int, input().split())
      cnt = table[b]
      sum += (c - b) * cnt
      table[c] +=  table[b]
      table[b] = 0
      print(sum)

Submission status: Runtime Error

Solution code:
def ans(n):
    s=0
    c=1
    s1=0
    l=[]
    for i in range(11):
        k=pow(26,c)
        s+=k
        l.append(k)
        if(s>=n):
            break
        c+=1
    ans=''
    c1=0
    for i in range(c-1,0,-1):
        if(n//l[i-1]==0):
            ans+='a'
        else:
            ans+=chr((n//l[i-1])+96)
        n=n%l[i-1]
    if(n==0):
        return ans(n-1)
    else:
        ans+=chr((n%26)+96)
        return ans(n)
n=int(input())
print(ans(n))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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



ans = []
mod = 1
cnt = 0
while cnt >= 1:
    k = math.floor(n/26)
    ans.append(al[k % 26 - 1])

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

Submission status: Runtime Error

Solution code:

N = int(input())
alphabet = [chr(ord('a') + i) for i in range(26)]
keta = 1
Nminused = N

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)

while True:
    if Nminused-26**(keta)<=0:
        N26 = list(map(int,Base_10_to_n(Nminused,26).split()))
        N26.reverse()
        if N26[0] == 0:
            N26[1] = N26[1] -1
            N26[0] = 26
            for i in range(keta-1):
                if N26[i+1] == 0:
                    N26[i+2] = N26[i+2] -1
                    N26[i+1] = 26
        N26.reverse()
        name = ""
        for i in range(keta-2):    
            name = name + alphabet[N26[i]-1]
        name= name + alphabet[N26[keta-1]]
        # q, mod = divmod(Nminused, 26)
        # if mod == 0:
        #     q = q -1
        #     mod = 26
        # for i in range(keta):    
        #     name = alphabet[q] + alphabet[mod-1]
        break
    else:
        for i in range(keta):
            Nminused = Nminused-26**(i+1)
        keta = keta +1
print(name)

Submission status: Runtime Error

Solution code:
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
 
def solve(n):
	#n = readInt()
	i = 1
	maxk = 26
	while 1:
		if n<=maxk:
			ke = i
			break
		else:
			i+=1
			maxk =maxk + 26**i
	#print(ke)
	#ke 桁数
	tar = n
	l= []
	while 1:
		if tar<=26:
			l.append(tar)
			break
		else:
			t = tar%(26**(i-1))
			#t = tar//(26**(i-1))
			t = (tar-t)//(26**(i-1))
			t = min(t,26)
			if t==0:
				l[-1]-=1
				t=26
			l.append(t)
			tar = tar - t*(26**(i-1))
			i-=1
 
	print("".join([chr(96+i) for i in l]))
 
solve(readInt())
#for i in range(1,1000000,26**2):
#	print(i)
#	solve(i)

Submission status: Runtime Error

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

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

print(al[n % 26 - 1])

ans = []
mod = 1
cnt = 0
while cnt >= 1:
    k = math.floor(n/26)
    ans.append(al[k % 26 - 1])

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

Submission status: Runtime Error

Solution code:
def ans(n):
    s=0
    c=1
    s1=0
    l=[]
    for i in range(11):
        k=pow(26,c)
        s+=k
        l.append(k)
        if(s>=n):
            break
        c+=1
    ans=''
    c1=0
    print(c)
    print(l)
    for i in range(c-1,0,-1):
        if(n//l[i-1]==0):
            ans+='a'
        else:
            ans+=chr((n//l[i-1])+96)
        print(n)
        n=n%l[i-1]
    if(n==0):
      return ans(n-1)
    else:
        ans+=chr((n%26)+96)
        return ans(n)
n=int(input())
print(ans(n))

Submission status: Runtime Error

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

while True:
    if N <= 26:
        matsubi = chr(96+N)
        ans += matsubi
        break
    else:
        if N % 26==0:
            matsubi = "z"
        else:
            a = int(N%26)
            matsubi = chr(96+a)
        ans += matsubi
        if N>26:
            N /= 26
    # if N<26:
    #     last = chr(96+N)
    #     ans += last
    #     break


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

Submission status: Runtime Error

Solution code:
import string

def change(X,words):
    if (int(X/words)):
        return change(int(X/words), words)+' '+str(X%words)
    return str(X%words)


str_list=string.ascii_lowercase
N=int(input())
after = change(N, 26)
after=list(after.split())
ans=''
for i in after:
    ans=ans+str_list[int(i,base=26)-1]
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
res = []
a_sum = sum(a)

for i in range(q):
    b,c = list(map(int,input().split()))
    co = a.count(b)
    print(co)
    for j in range(co):
        a[a.index(b)] = c
        a_sum += (c - b)
    
    res.append(a_sum)
        
for i in res:
    
    print(i)

Submission status: Runtime Error

Solution code:
import string
import itertools
n = int(input())
l = list(string.ascii_lowercase)
l.insert(0, 0)

amari = []
while n != 0:
    amari.append(n % 26)
    n = n // 26
amari.reverse()
answer_list = []
for i in amari:
    if type(i) == int:
        answer_list.append(l[i])
ans = ''.join(answer_list)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

dic = {}
for i in range(1, 27):
    dic[i] = chr(97 + i -1)
del dic[26]
dic[0] = "z"
temp = N 
ans = ""

while temp // 26 != 0:
    aa = temp % 26
    ans += dic[aa]
    temp = temp // 26
    if temp ==26:
      break
ans += dic[temp]
ans = ans[::-1]
print(ans)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
N1 = N
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"]
s = 0
for i in range(100):
    N /= 26
    s += 1
    A,B = math.modf(N)
    if B == 0:
        break
ans = []
if N1 % 26 == 0:
    ans.append(alp[25])
    for i in range(s-1):
        c,d = divmod(N1,26)
        ans.append(alp[b-2])
        if c == 1:
            ans.append(alp[0])
            break
        elif c == 0:
            break
else:
    for i in range(s):
		a,b = divmod(N1,26)
		ans.append(alp[b-1])
   		N1 //= 26
    	if a == 0:
    	   	break
new_ans = "".join(list(reversed(ans)))
print(new_ans)

Submission status: Runtime Error

Solution code:
N = int(input())

def f(n): #1文字～n文字までの数の和
    return 26**n

group = 1
newN = N


while True:
    newN = newN -f(group)
    if newN <= 0:
        break
    group += 1

number = newN + f(group)


def g(number, k):
    return (number//(26**k), number%(26**k))

res = ""
r = 0
for k in range(1,group+1):
    if group-k == 0:
        res += chr(q+96)
        break
    q,r = g(number, group-k)
    if r != 0:
        res += chr(q+1+96)
    elif r == 0 and group-k == 0:
        res += chr(q+26+96)
    else:
        res += chr(q+96)
    number = r

print(res)

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)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = 11
x2 = Base_10_to_n(x10, 16)
print( x2 )#"100011"が表示される．

"""
n = int(input())
import biscet
bb = [26/25 * (26 ** i -1) for i in range(26)]
m = biscet.bisect_left(bb,n)
sa = n - 26/25 * (26**m -1) + 1

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

list_n = [int(x) for x in list(str(sa))]
ans_num = base_convert(list_n,10,26)

change = {
    0:"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",

}

for i in range(len(ans_num)):
    ans_num[i] = change[ans_num[i]]
print(''.join(ans_num))

Submission status: Runtime Error

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

    i = 1
    sum = 0
    temp = 0
    while True:
        temp = 0
        i += 1
        sum += 1
        for j in range(1,i):
            temp += 26**j

        if N <= temp:
            break

    # 文字数はsum
    #for j in range(1,sum):
        #temp += 26**j
    #N -= temp

    ans = []
    flag = 0
    cnt = 0
    for j in range(sum):
        amari = N%26
        if amari == 0:
            flag = 1
            cnt += 1
            if cnt == 1:
                #print(amari,flag)
                ans.append(amari)
                N = N//26
                continue
        N = N//26
        #print(amari,flag)
        ans.append(amari-flag)

    #print(ans)

    ans2 = [0]*len(ans)
    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',0:'z'}
    for j in range(sum):
        ans2[sum-1-j] = dict[ans[j]]
    print(''.join(ans2))


main()

Submission status: Runtime Error

Solution code:
n=int(input())
m=1
f=0
while f==0:
    if 26*((26**m)-1)>=25*n:
        break
    else:
        m+=1
s=n-(26*((26**(m-1))-1)//25)
alphabet=['z']+[chr(i)for i in range(97,97+26)]
b=s%26
s//=26
x=alphabet(b)
l=[x]
k=2
while k<=m:
    b=s%26
    s//=26
    l.append(alphabet[b+1])
    k+=1
ans=reversed(l)
print(''.join(ans))

Submission status: Runtime Error

Solution code:
p = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
m = 1 #桁数
sm = 0
while 26 ** (m) < n:
    sm += 26 ** m
    m += 1
a = []
for j in range(m-1):
    t = m - j - 1
    tmp = n
    cnt = 0
    while 26 ** t * (cnt+1) <= n:
        cnt += 1
    a.append(p[cnt-1])
    n %= 26 ** t * cnt
a.append(p[n-1])
"""



a = []
while 26 ** i <= n:
    if i == 0:
        a.append(p[n % 26 - 1])
        i += 1
        n -= n % 26
        continue
    j = 0
    t = n
    while 26 ** i < t:
        t = t // 26 ** i
        j += 1
    a.append(p[j-1])

    i += 1
"""
print("".join(a))

Submission status: Runtime Error

Solution code:
n = int(input())

keta=0
while 26**keta<n:
  keta+=1

ans,i='',0
while keta>0:
  if keta==1:
    ans+=chr(ord('a') + (n-(keta**26)%26)-24)
  else:
    ans+=chr(ord('a') + (n-(keta**26)%26)-23)
  keta-=1
  n-=(keta**26)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
chr_num = 0
list_26 = [26 ** i for i in range(1, 12)]
for i in range(1, 12):
    if (N - sum(list_26[:i - 1])) // (26 ** i) == 0 or \
       ((N - sum(list_26[:i - 1])) == (26 ** i)):
        chr_num = i
        break
for j in range(chr_num):
    if j == 0:
        print(chr(((N - sum(list_26[:chr_num - 1])) % 26) + 96), end='')
    else:
        print(chr(((N - sum(list_26[:j])) // 26) + 97))
print()

Submission status: Runtime Error

Solution code:
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
 
def solve(n):
	#n = readInt()
	i = 1
	maxk = 26
	while 1:
		if n<=maxk:
			ke = i
			break
		else:
			i+=1
			maxk =maxk + 26**i
	#print(ke)
	#ke 桁数
	tar = n
	l= []
	while 1:
		if tar<=26:
			l.append(tar)
			break
		else:
			t = tar%(26**(i-1))
			#t = tar//(26**(i-1))
			t = (tar-t)//(26**(i-1))
			t = min(t,26)
			if t==0:
				l[-1]-=1
				t=26
			l.append(t)
			tar = tar - t*(26**(i-1))
			i-=1
 
	print("".join([chr(96+i) for i in l]))
 
solve(924093)
#for i in range(1,1000000,26**2):
#	print(i)
#	solve(i)

Submission status: Runtime Error

Solution code:
def main():
    suu="abcdefghijklmnopqrstuvwxyz"#26
    n=int(input())
    puts=""
    if n<27:#その数より小さい
        print(suu[n-1])
        return
    while True:
        temp=n%26
        puts=suu[temp-1]+puts
        n/=26
        if temp==0:#補正
            n-=1
        if n<27:
            puts=suu[n-1]+puts
            break
    print(puts)
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import string
a=string.ascii_lowercase
N=int(input())
ans=[]
count=1
n=26
while N>n:
    count+=1
    s=n
    n+=26**count
if N>26**count:
    for i in range(count):
        n=N//26**(count-i-1)
        if i!=count-1:
            m=N%26**(count-i-1)
        if n>=276:
            ans.append(a[25])
            N-=26**(count-i)
        else:
            ans.append(a[m-1])
else:
    while N>0:
        n=N//26
        m=N%26
        ans.append(a[m-1])
        N=n
Ans=[]
for i in range(len(ans)):
    Ans.append(ans[len(ans)-i-1])
print("".join(Ans))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
N = int(input())
ab = [chr(ord('a') + i) for i in range(26)]
j = 1
while True:
  temp = 1000000000000001//(26**j)
  j+=1
  if temp<1:
    break
ans = ''
for i in range(1, j+2):
  ax = (N//(26**(i-1)))%26
  if ax==0:
    ax = 25
  ans += ab[ax]
  if N//(26**i)<1:
    print(ans[::--])
    sys.exit()

Submission status: Runtime Error

Solution code:
N=int(input())
strlist=[chr(ord('a') + i) for i in range(26)]
import itertools

if N<=26:
  size=1
elif 26<N<=26**2:
  size=2
  N-=26+1
elif 26**2<N<=26**3:
  size=3
  N-=26**2+1
elif 26**3<N<=26**4:
  size=4
  N-=26**3+1
elif 26**4<N<=26**5:
  size=5
  N-=26**4+1
elif 26**5<N<=26**6:
  size=6
  N-=26**5+1
elif 26**6<N<=26**7:
  size=7
  N-=26**6+1



plist=[]
for i in itertools.combinations_with_replacement(strlist, size):
  plist.append(i)
  
  
ans=str()
for i in range(plist[N]):
  ans+=plist[N][i]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
a = 0
l = []

for i in range(1,12):
    a += 26**i
    l.append(a)

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

ans = []

while N != 0:
    x = N % 26
    N = N // 26
    ans.append(x)

ans.reverse()
ans_2 = []

for i in ans:
    if i == 0:
        ans_2.append(al[26])
    else:
        ans_2.append(al[i-1])

print("".join(ans_2))

Submission status: Runtime Error

Solution code:
import string
n = int(input())
s = [0] * 15
for i in range(15):
    if i == 0:
        s[i] = 26**(i+1)
    else:
        s[i] = s[i-1] + 26**(i+1)
max_len = 1
for i, v in enumerate(s):
    if v >= n:
        max_len = i+1
        break
res = n - 26 ** (max_len-1)
s_ = [0] * max_len
length = 0
for i in range(max_len):
    if i == 0:
        s_[i] = 26**(i+1)
    else:
        s_[i] = s_[i-1] + 26**(i+1)
for i, v in enumerate(s_):
    if v >= res:
        length = i+1
        break
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)
ans = []
for i in Base_10_to_n(res, 26):
    ans.append(string.ascii_lowercase[i])
print("a"*(max_len-length)+"".join(ans))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
A = [chr(ord('a') + i) for i in range(26)]

if N <= 26:
    print(A[N-1])
    exit()

B = math.log(N, 26)
B = math.ceil(B)
#print(B)

C = [26]
for i in range(2, B):
        D = 26**i
        C.append(D)

#print(C[::-1])

ans = []
for i in C[::-1]:
    D = int(N // i)
    if D == 0:
        ans.append(A[N-1])
        print(''.join(ans))
    else:
#        print(D)
        ans.append(A[D-1])
        N %= i
#        print(N)

Submission status: Runtime Error

Solution code:
import copy

dic2 = ["0", "1"]
dic16 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]
dic188 = ["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 down(num, be):
    dq = []
    
    while True:
        dq.append(num % be)
        num = num // be
        if num == 0:
            break
    da = copy.deepcopy(dq)

    return dq,da
    
    
    
def c10_16(num):
    dq,da = down(num, 16)
    
    for i in range(len(dq)):
        dq[(i+1)*(-1)] = dic16[da[i]]
    print("".join(dq))


def c10_2(num):
    dq,da = down(num, 2)
    
    for i in range(len(dq)):
        dq[(i+1)*(-1)] = dic2[da[i]]
    print("".join(dq))
    
    
def c10_188(num):
    dq,da = down(num, 26)
    
    for i in range(len(dq)):
        dq[(i+1)*(-1)] = dic188[da[i]]
    print("".join(dq))
    


#while True:
    """
    print("何をしますか?(10進数を16進数に変更->10_16)")
    kind = str(input())
    print("数値を入力してください、'f'で終了")
    try:
        Q = input()
        
        if Q == "f":
            break
        
        if type(Q) == "float":
            print("少数は扱えません")
        elif Q == str(int(Q)):
            Q = int(Q)
        else:
            print("その数字は扱えません")
            continue
    except ValueError:
        print("文字列は扱えません!!")
        continue
    if kind == "10_16":
        c10_16(Q)
    elif kind == "10_2":
        c10_2(Q)
    """
print(c10_188(input()))

    
"""
#追加用
while True:
    s = input()
    dic188.append(str(s))
    print(dic188)
"""

Submission status: Runtime Error

Solution code:
p = [pow(26, i) for i in range(17)]
num = [0 for i in range(17)]
chars = ["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(17):
  if i == 0:
    continue
  if i == 1:
    num[i] = 26
  else:
    num[i] = num[i-1] + p[i]
n = int(input())
ans = ''
while n > 0:
  i = 16
  while n < num[i]:
    i -= 1
  if n == num[i]:
    ans += "z"
    n -= p[i]
  else:
    q = n // num[i]
    ans += chars[q - 1]
    n -= q * num[i]
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input()) -1
# x = 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"]
alp = [chr(i) for i in range(97,97+26)]

if  n >= 0 and 25 >= n:
    ans = alp[n]
elif n >= 26 and 701 >= n:
    temp = n-26
    temp = temp//26
    ans2 = alp[n//26]
    # ans2 = alp[temp]
    ans1 = alp[n%26]
    ans = ans2 + ans1
elif n >= 702 and 18277 >= n:
    temp = n-26*26-26
    ans3 = alp[(temp//(26*26))]
    temp = temp%(26*26)
    ans2 = alp[temp//26]
    ans1 = alp[temp%26]
    ans = ans3 + ans2 + ans1
elif n >= 18278 and 475253 >= n:
    temp = n-26*26*26-26*26-26
    ans4 = alp[temp//(26*26*26)]
    temp = temp%(26*26*26)
    ans3 = alp[temp//(26*26)]
    temp = temp%(26*26)
    ans2 = alp[temp//26]
    ans1 = alp[temp%26]
    ans = ans4 + ans3 + ans2 + ans1
elif n >= 475254 :
    temp = n-26*26*26*26-26*26*26-26*26-26
    ans5 = alp[temp//(26*26*26*26)]
    temp = temp%(26*26)
    ans4 = alp[temp//(26*26*26)]
    temp = temp%(26*26)
    ans3 = alp[temp//(26*26)]
    temp = temp%(26*26)
    ans2 = alp[temp//26]
    ans1 = alp[temp%26]
    ans = ans5 +ans4 + ans3 + ans2 + ans1


print(ans)

Submission status: Runtime Error

Solution code:
import sys
import itertools
import resource
xrange = lambda stop: iter(itertools.count().next, stop)
sys.setrecursionlimit(1000000)
ys.setrecursionlimit(10 ** 9)
resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))
n = int(input())

chars ={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'}

if n <= 26:
    print(chars[n])
    sys.exit()



def Base_10_to_26(X):
    if (X//26):
        return Base_10_to_26(int(X//26))+chars[int(X%26)]
    return chars[int(X%n)]

print(Base_10_to_26(n))

Submission status: Runtime Error

Solution code:
import sys
len_list = list()
len_list.append(1)
l1 = 26
len_list.append(l1)
l2 = l1*26
len_list.append(l2)
l3 = l2*26
len_list.append(l3)
l4 = l3*26
len_list.append(l4)
l5 = l4*26
len_list.append(l5)
l6 = l5*26
len_list.append(l6)
l7 = l6*26
len_list.append(l7)
l8 = l7*26
len_list.append(l8)
l9 = l8*26
len_list.append(l9)
l10 = l9*26
len_list.append(l10)


alpha = ['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())

name = ''
len = 0
if N > l10+l9+l8+l7+l6+l5+l4+l3+l2+l1:
    len=10
elif N > l9+l8+l7+l6+l5+l4+l3+l2+l1:
    len=9
elif N > l8+l7+l6+l5+l4+l3+l2+l1:
    len=8
elif N > l7+l6+l5+l4+l3+l2+l1:
    len=7
elif N > l6+l5+l4+l3+l2+l1:
    len=6
elif N > l5+l4+l3+l2+l1:
    len=5
elif N > l4+l3+l2+l1:
    len=4
elif N > l3+l2+l1:
    len=3
elif N > l2+l1:
    len=2
elif N > l1:
    len=1
else:
    len=0

while len >= 0:
    if N // len_list[len] > 0:
        if len == 0:
            name += alpha[(N // len_list[len]) -1]
        elif N % len_list[len] == 0:
            name += alpha[(N // len_list[len]) -2]
            N = len_list[len]
        else:
            name += alpha[(N // len_list[len]) -1]
            N = N % len_list[len]
    else:
        name += 'a'
    len -= 1
print(name)

Submission status: Runtime Error

Solution code:
n=int(input())
def s(n):
    la=[chr(i) for i in range(97,97+26)]
    
    char=[]
    wa=26
    cnt=1
    while n>wa:
        wa=wa*26+wa
        cnt+=1
    nn=n
    
    while nn!=0:
        for j in range(27):
            if n-((j+1)*26**(cnt-1))<0:
                break
       
        char.append(la[j])
        nn=nn-j*(26**(cnt-1))
    print("".join(char))
s(n)

Submission status: Runtime Error

Solution code:
import copy
dic188 = ["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 down(num, be):
    dq = []
    
    while True:
        dq.append(num % be)
        num = num // be
        if num == 0:
            break
    da = copy.deepcopy(dq)

    return dq,da
def c10_188(num):
    dq,da = down(num, 26)
    
    for i in range(len(dq)):
        dq[(i+1)*(-1)] = dic188[da[i]]
    print("".join(dq))
c10_188(input())

Submission status: Runtime Error

Solution code:
n = int(input())

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


i = 1
name = []
while n >= 1:
    a = n%26
    name.append(num2str[a])
    n = n-(a*26**i)

print(''.join(name))

Submission status: Runtime Error

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

an =[]

for i in range(11):
    if 26**(10-i)<=n and i<=10:
        wk = n//26**(10-i)
        n=n%26**(10-i)
        an.append(chr(wk%26+96))
    else:
        an.append(chr(n+96))
print(''.join(an))

Submission status: Runtime Error

Solution code:
N = int(input())

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ans = []
N -=1
while N>0:
    n = N%26
    ans.append(n)
    N = N//26

# print(ans)
if ans[-1] == 1:
    ans.pop()
o = []
for i,a in enumerate(ans):
    if i == 0:
        o.append(ascii_lowercase[a])
    else:
        o.append(ascii_lowercase[a-1])

o.reverse()
print(''.join(o))

Submission status: Runtime Error

Solution code:
import itertools 
x = int(input())
list_ = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "w", "z" ]
len(list_)
kara = []
if x >= 1 and x <= 26 :
    ans = 0
    for i in itertools.product(list_, repeat = 1):
        ans += 1
        if ans == n:
            print(*i, sep = '')
elif 27<=x and x<= 702:
    ans = 26
    for i in itertools.product(list_, repeat = 2):
        ans += 1
        if ans == n:
            print(*i, sep = '')
elif 703<=x and x<=18278:
    ans = 702
    for i in itertools.product(list_, repeat = 3):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 475254:
    ans = 18278
    for i in itertools.product(list_, repeat = 4):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 12356630:
    ans =475254
    for i in itertools.product(list_, repeat = 5):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 321272406:
    ans = 12356630
    for i in itertools.product(list_, repeat = 6):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 8353082582:
    ans = 321272406
    for i in itertools.product(list_, repeat = 7):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 217180147158:
    ans = 8353082582
    for i in itertools.product(list_, repeat = 8):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 5646683826134:
    ans = 217180147158
    for i in itertools.product(list_, repeat = 9):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 146813779479510:
    ans = 5646683826134
    for i in itertools.product(list_, repeat = 10):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 3817158266467286:
    ans = 5646683826134
    for i in itertools.product(list_, repeat = 11):
        ans += 1
        if ans == n:
            print(*i, sep='')

Submission status: Runtime Error

Solution code:
def ans(n):
  s=0
    c=1
    s1=0
    l=[]
    for i in range(11):
        k=pow(26,c)
        s+=k
        l.append(k)
        if(s>=n):
            break
        c+=1
    ans=''
    c1=0
    print(c)
    print(l)
    for i in range(c-1,0,-1):
        if(n//l[i-1]==0):
            ans+='a'
        else:
            ans+=chr((n//l[i-1])+96)
        print(n)
        n=n%l[i-1]
    if(n==0):
      return ans(n-1)
    else:
        ans+=chr((n%26)+96)
        return ans(n)
n=int(input())
print(ans(n))

Submission status: Runtime Error

Solution code:
n = int(input())
x = "abcdefghijklmnopqrstuvwxyz"
a = n
s = ""
if n <= 26:
    print(x[n-1])
else:
    while a > 26:
        s += x[(a % 26) - 1]
        if a // 26 < 26 and a % 26 == 0:
            a = a // 26 - 1
            break
        else:
            a = a // 26
    s += x[a % 26 - 1]
    print(s[::-1]

Submission status: Runtime Error

Solution code:
import string

def change(X,words):
    if (int(X/words)):
        return change(int(X/words), words)+' '+str(X%words)
    return str(X%words)


str_list=string.ascii_lowercase
N=int(input())
after = change(N, 26)
after=list(after.split())
ans=''
for i in after:
    ans=ans+str_list[int(i,bace=26)-1]
print(ans)

Submission status: Runtime Error

Solution code:
# C - One Quadrillion and One Dalmatians
import bisect

N = int(input())

keta = [26 ** i for i in range(1, 12)]
keta_sum = [0] * 12
for i in range(11):
    keta_sum[i+1] = keta_sum[i] + keta[i]
k = bisect.bisect_left(keta_sum, N)
ans = ''

for i in range(k):
    n = N - keta_sum[k-i-1]
    if n > 26:
        s = n // 26
        t = n % 26
    else:
        s = n
        t = n
    if t == 0:
        t = 26
    ans = ans + chr(t+96)
    N = (n//26) + (n%26) + 26

print(ans)

Submission status: Runtime Error

Solution code:
import sys
n = int(input())
dp = ["0"]*12

def main(p):
  count = 0
  m = p
  while (m-1)//26 >= 1:
    m = m//26
    count += 1
  dp[(-1)*count-1] = chr(m + 96)
  p -= 26**count*m
  if count == 0:
    #print(dp)
    a = "".join(dp)
    print(a.replace("0","")
    sys.exit()
  else:
    main(p)
main(n)