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 main():
    n = int(input())
    ans = []
    A = [3817158266467286,  146813779479510, 5646683826134, 217180147158, 8353082582, 321272406, 12356630, 475254,  18278, 702, 26]
    for i in range(11, 0, -1):
        if n > A[11-i]:
            a = n // 26**i
            if a == 27:
                a = 26
                print('i',i,  'a',a)
                ans.append(chr(96+a))
                n = n - (26**i*a)
    ans.append(chr(96+n))
    print(*ans, sep='')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:


N = int(input())

w='abcdefghijklmnopqrstuvwxyz'

d=[1]

for i in range(1,13):
   d.append(d[i-1]*26+1)

for i in range(len(d)):
    if N>=d[len(d)-1-i]:
        k=len(d)-i
        break

a=[]
s=''
for i in range(k):
    a.append(N//26**(k-i-1))
    N-=(N//26**(i+1))*26**(i+1)
    s+=w[a[i]-1]

print(s)

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:
import string
alphabet = list(string.ascii_lowercase)

N = int(input())

n = [26]
i = 1
x = 1

while x < 1000000000000001:
    x = n[i-1]+26**(i+1)
    n.append(x)
    i += 1

k = 0
while N >= n[k]:
    k +=1

list_q = []
list_mod = []

if k > 1:
    q, mod = divmod(N-n[k-1], n[k-2])
    list_q.append(q)
    list_mod.append(mod)
else:
    print(alphabet[N-1])

j = 0



while mod > n[k-2-j]:
    q, mod = divmod(mod, n[k-2-j])
    list_q.append(q)
    list_mod.append(mod)
    j += 1

name = 0
    
for p in range(k):
    name += alphabet[list_q[p]-1]

print(name)

Submission status: Runtime Error

Solution code:
n = int(input())
rev = []
nn = n
def c(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return n

def d(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return k

n = c(n)
while n > 26:
    r = n % 26
    rev.append(r)
    n //= 26
rev.append(n)
sl = list('abcdefghijklmnopqrstuvwxyz')
l = len(rev)
for i in range(1, l):
    rev[i] += 1
name = []

for i in range(d(nn) - l):
    name.append('a')
for i in range(len(rev)):
    d = sl[rev[l - 1 - i] - 1]
    name.append(d)
dogname = ''.join(name)
print(dogname)

Submission status: Runtime Error

Solution code:
N = int(input())
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']

def find_name(tmp_N, p, keta, alpha):
  if keta == 1:
    for i in range(len(alpha)):
      #print(tmp_N + (i+1))
      if tmp_N + (i+1) == N:
        p.append(i)
        return p
  else:
    for i in range(len(alpha)):
      #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))
      if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):
        #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))
        p.append(i)
        tmp_N = tmp_N + 26**(keta-1)*i
        keta -= 1
        return find_name(tmp_N, p, keta, alpha)
    
# 桁数の確認
keta = 1
while 1:
  tmp_N = 26**(keta-1)
  if tmp_N + 26**(keta-1)+1 <= N <= tmp_N + 26**keta:
    break
  else:
    keta += 1
#print(keta)

tmp_N = 0
if keta == 1:
  tmp_N = 0
else:
  tmp_N = 26**(keta-1)
#print(tmp_N)
p = []
p = find_name(tmp_N, p, keta, alpha)
out = ''
#print(p)
for i in range(len(p)):
  out += alpha[p[i]]
print(out)

Submission status: Runtime Error

Solution code:
list = [0,'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']
num_list =[0]
for i in range(1,15):
    num_list.append(26**i+num_list[i-1])

n = int(input())
i = 0
while True:
    if num_list[i] >= n:
        break
    else:
        i +=1


word = []
for j in range(i,0,-1):
    x = n//26**(j-1)
    elif x==27:
        word.append(26)
        n = n -26**(j-1)*(n//26**(j-1))+26**(j-1)
    else:
        word.append(x)
        n = n -26**(j-1)*(n//26**(j-1))
while 0 in word:
    p = word.index(0)
    word[p-1] = word[p-1]-1
    word[p] = 26
h =''
for k in range(len(word)):
    h+=str(list[word[k]])
print(h)

Submission status: Runtime Error

Solution code:
MAX = 1000000000000001
n = int(input())

def chenge_moji (num):
  if num == 1:
    return "a"
  elif num == 2:
    return "b"
  elif num == 3:
    return "c"
  elif num == 4:
    return "d"
  elif num == 5:
    return "e"
  elif num == 6:
    return "f"
  elif num == 7:
    return "g"
  elif num == 8:
    return "h"
  elif num == 9:
    return "i"
  elif num == 10:
    return "j"
  elif num == 11:
    return "k"
  elif num == 12:
    return "l"
  elif num == 13:
    return "m"
  elif num == 14:
    return "n"
  elif num == 15:
    return "o"
  elif num == 16:
    return "p"
  elif num == 17:
    return "q"
  elif num == 18:
    return "r"
  elif num == 19:
    return "s"
  elif num == 20:
    return "t"
  elif num == 21:
    return "u"
  elif num == 22:
    return "v"
  elif num == 23:
    return "w"
  elif num == 24:
    return "x"
  elif num == 25:
    return "y"
  elif num == 0:
    return "z"

  
buffer = 1
cutlist = []
while True :
  buffer *= 26
  cutlist.append(buffer)
  buffer += 1
  if(buffer > MAX):
    break
target = 0
for i in range(len(cutlist)):
  if n/cutlist[i] <= 1:
    target= i
    break

moji = []
divn = n
for j in range(target+1):
  moji.append(divn%26)

  divn = int(divn/26)
  if divn < 1:
    break
count = 0
for o in moji:
  if count == 0:
    before = o
    count += 1
    continue
  if (before == 0):
    moji[count] -= 1
  before = moji[count]
  count += 1
moji.reverse()
text = ""
for m in moji:
  text += chenge_moji(m)

print(text)

Submission status: Runtime Error

Solution code:

# Python 3 program to implement 
# the above approach 
from math import pow
  
# Function to calculate number of characters 
# in corresponding string of 'A' and 'B' 
def no_of_characters(M): 
      
    # Since the minimum number 
    # of characters will be 1 
    k = 1
  
    # Calculating number of characters 
    while (True): 
          
        # Since k length string can 
        # represent at most pow(2, k+1)-2 
        # that is if k = 4, it can 
        # represent at most pow(2, 4+1)-2 = 30 
        # so we have to calculate the 
        # length of the corresponding string 
        if (pow(2, k + 1) - 2 < M): 
            k += 1
        else: 
            break
  
    # return the length of 
    # the corresponding string 
    return k 
  
# Function to print corresponding 
# string of 'A' and 'B' 
def print_string(M): 
      
    # Find length of string 
    k = no_of_characters(M) 
  
    # Since the first number that can be  
    # represented by k length string will  
    # be (pow(2, k)-2)+1 and it will be  
    # AAA...A, k times, therefore, N will  
    # store that how much we have to print 
    N = M - (pow(2, k) - 2) 
  
    # At a particular time, 
    # we have to decide whether 
    # we have to print 'A' or 'B', 
    # this can be check by calculating 
    # the value of pow(2, k - 1) 
    while (k > 0): 
        num = pow(2, k - 1) 
  
        if (num >= N): 
            print("A", end = "") 
        else: 
            print("B", end = "") 
            N -= num 
        k -= 1
          
    print("\n", end = "") 
  

M=input()
print_string(M)

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):    
            name = name + alphabet[N26[i]-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:
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:
ml = []
n = int(input())

for i in range(1,11):
    if (26**i-1)*26/25 >= n:
        break
a = n - (26**(i-1)-1)*26/25

if n == (26**i-1)*26/25:
    new =[]
    for lk in range(i):
        new.append('z')
    print("".join(new))
else:

    lis =[]
    for k in range(i-1):
        lis.append(a%26)
        a = a//26

    alp = list('abcdefghijklmnopqrstuvwxyz')
    if a==26:
        lis.append(25)
    else:
        lis.append(a)
    lis.reverse()
    
    m = lis[-1]
    
    del lis[-1]
    for j in lis:
        ml.append(alp[int(j)])
    ml.append(alp[int(m)-1])
    print("".join(ml))

Submission status: Runtime Error

Solution code:
MAX = 1000000000000001

n = int(input())

s = []
s_sum = 0
s_i = 0
while s_sum <= MAX:
    s_sum += 26**s_i
    s.append(s_sum)
    s_i += 1

def is_ok(arg):
    return s[arg] <= n < s[arg+1]

def meguru_binary_search(ng, ok):
    while abs(ng - ok) > 1:
        mid = (ng + ok) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

k = meguru_binary_search(len(s), 0) + 1

def solve(x, y):
    x -= (s[y-1] - 1)
    tmp = x // (26**(y-1))
    return chr(tmp + 97)

ans = ''
for i in range(k, 0, -1):
    ans += solve(n, k)

print(ans)

Submission status: Runtime Error

Solution code:

import copy

bs = [26**i for i in range(0, 20)]
""" pull up """
for i in range(1, len(bs)):
    bs[i] += bs[i-1]
# print(bs)

def dec_wac(num, params):
    rs = []
    f = False
    for d, p in reversed(params):
        r = num//(26**d)
        # print(p, r, num)
        if r == 27:
            rs.append(26)
            num -= r*(26**d)
            f = True
        elif f and r == 1:
            rs.append(26)
            num -= r*(26**d)
        else:
            rs.append(r)
            num -= r*(26**d)
            f = False
    return rs

def loop(num):
    """ calc max """
    a = [(idx,b) for idx, b in enumerate(bs) if b <= num]
    # print(a)
    k_num = num - a[-1][1]
    params = [(d,kn) for d, kn in a]
    #print(k_num, params, dec_wac(num, params))
    return dec_wac(num, params)

cs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ".lower())

a = "".joi

Submission status: Runtime Error

Solution code:
n = int(input().strip())
dic = {
    0:  'z',
    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 = ''

keta = 15

while True:
    if (26 ** keta) <= n:
        break
    keta -= 1

for i in range(keta, -1, -1):
    sho = n // (26 ** i)
    amari = n % (26 ** i)
    if amari == 26:
        continue
    else:
        ans += dic[amari]
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
norigin = n
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']

ans26 = n//26
mod26 = n % 26
digit = [26, 676, 17576, 456976, 11881376, 308915776,
         8031810176, 208827064576, 5429503678976, 141167095653376]
ans = []

digitnum = 0
while True:
    digitnum += 1
    if (n - digit[digitnum - 1] <= 0):
        break
    else:
        n = n - digit[digitnum - 1]

for i in range(digitnum):
    ans.append(alpha[n % 26])
    n = n - (26 * (n//26))
print(''.join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
rev = []
nn = n
def c(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return n

def d(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return k

n = c(n)
while n > 26:
    r = n % 26
    if r == 0:
        r = 26
    rev.append(r)
    n //= 26
rev.append(n)
sl = list('abcdefghijklmnopqrstuvwxyz')
l = len(rev)
for i in range(1, l):
    rev[i] += 1
name = []

for i in range(d(nn) - l):
    name.append('a')
for i in range(len(rev)):
    d = sl[rev[l - 1 - i] - 1]
    name.append(d)
dogname = ''.join(name)
print(dogname)

Submission status: Runtime Error

Solution code:
N=int(input())
L =[chr(ord('a') + i) for i in range(26)]
K=str
i=1
while True:
  if 26**i>=N:
      break
  else:
    i+=1
if i == 1:
  print(L[N-1])
else:
  for h in range(1,i+1):
    if h==1:
      P=N%26
      K+=str(L[P-1])
    else:
      T=(N/26-1)*(h-1)
      K+=L[T-1]
    
print(K)

Submission status: Runtime Error

Solution code:
N = int(input())

print("1000000000000001")

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

n1 = 0
n2 = 0
n3 = 0
n4 = 0
n5 = 0
n6 = 0
n7 = 0
n8 = 0
n9 = 0
n10 = 0

if N-1 < 26:
    n1 = N%26 - 1
    print(alp[n1])
elif N-1<26 + 26**2:
    n1 = N%26 - 1
    n2 = int((N-26**1)%26**1)
    print(alp[n2] + alp[n1])
elif N-1<26 + 26**2 + 26**3:
    n1 = N%26 - 1
    n2 = int((N-26**1-26**2)/26**2)
    n3 = int((N-26**1-26**2)/26**3)
    print(n1, n2, n3)
    print(alp[n3] + alp[n2] + alp[n1])

Submission status: Runtime Error

Solution code:
N = int(input())
keta = [0 for i in range(11)]
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"
]

wa = 0
prev = 0
max = []
while N > 0:
  for i in range(12):
    wa = prev + 26**i
    if wa >= N:
      keta[i-1] = abc[(N//prev)-1]
      max = i
      break
    prev = wa
  N -= (N//prev)*(26**max)
  max = 0
  
keta.reverse()
for i in range(11):
  if keta[i] != 0:
    p = i
    break
    
ans = ""
for i in keta[p:]:
  ans += i
print(ans)

Submission status: Runtime Error

Solution code:
a=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','z']
if a<27:
 print(alp[a-1])
else:
 b=a//26

 c=a%26
 ans=""
 if b==1:
    ans+='a'
 for i in range(1,17):
  if b/(10**(i))>1:
    d=int(b/(10**(i)))
    ans+=alp[d-1]
  else:
    break
 ans+=alp[c-1]

 print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
dic_items = {-1:'z',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'}
ans = []
while n != 0:
  ans.append(n%26)
  n = n//26
#print(ans)
for i in range(len(ans)):
  if ans[i] == 0:
    j = i+1
    if j < len(ans):
      ans[j] -= 1
      if j == len(ans)-1:
        ans[i] = 26
    else:
      ans.pop()
for i in range(len(ans)):
  print(dic_items[ans[len(ans)-1-i]-1],end='')

Submission status: Runtime Error

Solution code:
import string

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

if (N >= 1 and N <= 26):
    print(al[N - 1])
    exit()
elif (N >= 27 and N <= 702):
    n = N // 26
    amari = N % 26
    if (amari == 0 and n != 27):
        print(al[n - 1] + al[25])
        exit()
    elif (amari == 0 and n == 27):
        print(al[25] + al[25])
        exit()
    else:
        print(al[n - 1] + al[amari - 1])
elif (N >= 703):
    s = ''
    num = 26
    while N > 26:
        amari = N % num
        N //= 26
        if (amari == 0):
            N -= 1
        if (amari == 0):
            s += al[25]
        else:
            s += al[amari - 1]
if (N == 0):
    s += al[25]
else:
    s += al[N - 1]
print(s[::-1])

Submission status: Runtime Error

Solution code:
from itertools import accumulate
from bisect import bisect_left
def perm_count(fact, n, r):
    return fact[n] // (fact[n - r])

def resolve():
    n = int(input())
    fact = [0 for i in range(27)]
    fact[0] = 1
    perm = [0] * 27

    for i in range(1, 27):
        fact[i] = fact[i-1] * 26
    for i in range(1, 27):
        perm[i] = (perm_count(fact, 26, i))
    acc_perm = list(accumulate(perm))
    idx = bisect_left(acc_perm, n)
    alf = "abcdefghijklmnopqrstuvwxyz"
    ans = []
    perm[0] = 1
    for i in range(idx)[::-1]:
        s = n // perm[i]
        ans.append(alf[s-1])
        n -= perm[i] * s
    print("".join(ans))

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
a=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','z']
if a<27:
 print(alp[a-1])
else:
 b=a//26

 c=a%26
 ans=""
 if b==1:
    ans+='a'
 for i in range(0,17):
  if b/(10**(i))>1:
    d=int(b/(10**(i)))
    ans+=alp[d-1]
  else:
    break
 ans+=alp[c-1]

 print(ans)

Submission status: Runtime Error

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

ascii = 'abcdefghijklmnopqrstuvwxyz'

out = ''
l = []
while n > 0:
    l.append(n%26)
    out = str(n%26) + ", " + out
    n = int(n/26)
# print(out)
# print(l)

flg = 0
for i in range(len(l)):
    if l[i] != 0:
        l[i] -= 1
    else:
        if i == len(l)-2:
            flg = 1
        l[i+1] = 0
        l[i] = 25

if len(l)==1:
    l[0] -= 1

name = ""
for i in range(len(l)-flg):
    name = ascii[l[i]] + name
print(name)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 21 21:17:02 2020

@author: akinari
"""


N = int(input())

if N <= 26: #1
    ans = chr(N+96)
    
elif N <= 26 ** 2 + 26: #2
    N2 = int(N / 26)
    N1 = N % 26
    ans = chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26 ** 3 + 26 **2 +26: #3
    N3 = int(N / 26**2)
    N2 = int((N - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)

elif N <= 26**4 + 26**3 + 26**2 * 26: #4
    N4 = int(N / 26**3)
    N3 = int((N - 26**3*N4) / 26**2)
    N2 = int((N - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N5 = int(N / 26**4)
    N4 = int((N - 26**4*N5 )/ 26**3)
    N3 = int((N - 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26**6 + 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N6 = int(N /26**5)
    N5 = int((N - 26**5*N6)/ 26**4)
    N4 = int((N - 26**5*N6- 26**4*N5 )/ 26**3)
    N3 = int((N - 26**5*N6- 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**5*N6- 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N6 + 96) + chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26**7 + 26**6 + 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N7 = int(N / 26**6)
    N6 = int((N - 26**6*N7) /26**5)
    N5 = int((N - 26**6*N7 - 26**5*N6) / 26**4)
    N4 = int((N - 26**6*N7 - 26**5*N6 - 26**4*N5 ) / 26**3)
    N3 = int((N - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N7 + 96) + chr(N6 + 96) + chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26**8 + 26**7 + 26**6 + 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N8 = int(N / 26**7)
    N7 = int((N - 26**7*N8) / 26**6)
    N6 = int((N - 26**7*N8 - 26**6*N7) /26**5)
    N5 = int((N - 26**7*N8 - 26**6*N7 - 26**5*N6) / 26**4)
    N4 = int((N - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 ) / 26**3)
    N3 = int((N - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N8 + 96) + chr(N7 + 96) + chr(N6 + 96) + chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
    
elif N <= 26**9 + 26**8 + 26**7 + 26**6 + 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N9 = int(N / 26**8)
    N8 = int((N - 26**8*N9) / 26**7)
    N7 = int((N - 26**8*N9 - 26**7*N8) / 26**6)
    N6 = int((N - 26**8*N9 - 26**7*N8 - 26**6*N7) /26**5)
    N5 = int((N - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6) / 26**4)
    N4 = int((N - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 ) / 26**3)
    N3 = int((N - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N9 + 96) + chr(N8 + 96) + chr(N7 + 96) + chr(N6 + 96) + chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
 
elif N <= 26**10 + 26**9 + 26**8 + 26**7 + 26**6 + 26**5 + 26**4 + 26**3 + 26**2 * 26:
    N10 = int(N / 26**9)
    N9 = int((N - 26**9*N10)/ 26**8)
    N8 = int((N - 26**9*N10 - 26**8*N9) / 26**7)
    N7 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8) / 26**6)
    N6 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8 - 26**6*N7) /26**5)
    N5 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6) / 26**4)
    N4 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 ) / 26**3)
    N3 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4) / 26**2)
    N2 = int((N - 26**9*N10 - 26**8*N9 - 26**7*N8 - 26**6*N7 - 26**5*N6 - 26**4*N5 - 26**3*N4  - 26**2*N3) / 26)
    N1 = N % 26
    ans = chr(N10 + 96) + chr(N9 + 96) + chr(N8 + 96) + chr(N7 + 96) + chr(N6 + 96) + chr(N5 + 96) + chr(N4 + 96) + chr(N3 + 96) + chr(N2 + 96) + chr(N1 + 96)
   
    
print(ans)

Submission status: Runtime Error

Solution code:
import string
n = int(input())
letters = list(string.ascii_lowercase)
name = ''
store = []
b = 0
while int(n) > 26:
    a = n%26
    n /= 26
    b += 1
    store.append(int(a))
if store[0] == 0:
    for i in range(0, b):
        name += 'z'
else:
    for i in store:
        name += letters[i-1]
    name += letters[int(n)-1]
print(name[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
n = 26
if N == n*n + n:
    print("zz")
elif N == n**3 + n**2 + n:
    print("zzz")
elif N == n**4 + n**3 + n**2 + n:
    print("zzzz")
elif N == n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzz")
elif N == n**6 + n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzzz")
elif N == n**7 + n**6 + n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzzzz")
elif N == n**8 + n**7 + n**6 + n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzzzzz")
elif N == n**9 + n**8 + n**7 + n**6 + n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzzzzzz")
elif N == n**10 + n**9 + n**8 + n**7 + n**6 + n**5 + n**4 + n**3 + n**2 + n:
    print("zzzzzzzzzz")
else:
    import string
    alphabets = string.ascii_lowercase
    result = ""
    tmp = N
    while tmp >= n:
        idx = tmp%n - 1
        result = alphabets[idx] + result
        tmp = int(tmp/n)
    if (idx>=0):
        idx = tmp%n - 1
        result = alphabets[idx] + result
    print(result)

Submission status: Runtime Error

Solution code:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    con = 0
    for i in range(10):
        con += 26**(i+1)
        if n <= con:
           num = i + 1
           break
    b = (n - 26**(num-1)+1)
    c = (n - 26**(num-1))
    if num == 1:
        a = b % 26
        if a == 1:
            ans = "a"
        if a == 2:
            ans = "b"
        if a == 3:
            ans = "c"
        if a == 4:
            ans = "d"
        if a == 5:
            ans = "e"
        if a == 6:
            ans = "f"
        if a == 7:
            ans = "g"
        if a == 8:
            ans = "h"
        if a == 9:
            ans = "i"
        if a ==10:
            ans = "j"
        if a == 11:
            ans = "k"
        if a == 12:
            ans = "l"
        if a == 13:
            ans = "m"
        if a == 14:
            ans = "n"
        if a == 15:
            ans = "o"
        if a == 16:
            ans = "p"
        if a == 17:
            ans = "q"
        if a == 18:
            ans = "r"
        if a == 19:
            ans = "s"
        if a == 20:
            ans = "t"
        if a == 21:
            ans = "u"
        if a == 22:
            ans = "v"
        if a == 23:
            ans = "w"
        if a == 24:
            ans = "x"
        if a == 25:
            ans = "y"
        if a == 0:
            ans = "z"
        print(ans, end="")
        return

    for i in range(num):
        if i == num-1:
            if c == 1:
                ans = "a"
            elif c == 2:
                ans = "b"
            elif c == 3:
                ans  = "c"
            elif c == 4:
                ans = "d"
            elif c == 5:
                ans = "e"
            elif c == 6:
                ans = "f"
            elif c == 7:
                ans = "g"
            elif c == 8:
                ans = "h"
            elif c == 9:
                ans = "i"
            elif c == 10:
                ans = "j"
            elif c == 11:
                ans = "k"
            elif c == 12:
                ans = "l"
            elif c == 13:
                ans = "m"
            elif c == 14:
                ans = "n"
            elif c == 15:
                ans = "o"
            elif c == 16:
                ans = "p"
            elif c == 17:
                ans = "q"
            elif c == 18:
                ans = "r"
            elif c == 19:
                ans = "s"
            elif c == 20:
                ans = "t"
            elif c == 21:
                ans = "u"
            elif c == 22:
                ans = "v"
            elif c == 23:
                ans = "w"
            elif c == 24:
                ans = "x"
            elif c == 25:
                ans = "y"
            else:
                ans = "z"
            print(ans, end="")
        a = c // (26**(num-1-i))
        c = c % (26**(num-1-i))
        if c == 0:
            c = 26**(num-1-i)
        if i < num - 1:
            if i != 0:
                if a == 0:
                    a = 25
                else:
                    a -= 1
            if a == 0:
                ans = "a"
            elif a == 1:
                ans = "b"
            elif a == 2:
                ans = "c"
            elif a == 3:
                ans = "d"
            elif a == 4:
                ans = "e"
            elif a == 5:
                ans = "f"
            elif a == 6:
                ans = "g"
            elif a == 7:
                ans = "h"
            elif a == 8:
                ans = "i"
            elif a == 9:
                ans = "j"
            elif a == 10:
                ans = "k"
            elif a == 11:
                ans = "l"
            elif a == 12:
                ans = "m"
            elif a == 13:
                ans = "n"
            elif a == 14:
                ans = "o"
            elif a == 15:
                ans = "p"
            elif a == 16:
                ans = "q"
            elif a == 17:
                ans = "r"
            elif a == 18:
                ans = "s"
            elif a == 19:
                ans = "t"
            elif a == 20:
                ans = "u"
            elif a == 21:
                ans = "v"
            elif a == 22:
                ans = "w"
            elif a == 23:
                ans = "x"
            elif a == 24:
                ans = "y"
            elif a == 25:
                ans = "z"
            print(ans, end="")


main()

Submission status: Runtime Error

Solution code:
A="abcdefghijklmnopqrstuvwxyz"
n=int(input())-1
name=[]
while n>0:
    temp=n%26
    name.append(temp)
    n//=26
length=len(name)
for i in range(length-1):
    print(A[name[length-i-1]-1],end="")
print(A[name[0]])

Submission status: Runtime Error

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