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:
import math
n = int(input())
leng = int(math.log(n, 26))
res = []
for i in reversed(range(leng)):
    leng = int(math.log(n, 26))
    num = n // 26**leng
    res.append(chr(96+num))
    n -= 26**leng*num

if n%26 != 0:
    res.append(chr(96+n%26))

print(''.join(res))

Submission status: Runtime Error

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


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

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
i = 0
a,b = divmod(N, 26)
A = list(range(a))

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

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

Submission status: Runtime Error

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

d = int(math.log(25*N+26, 26)-0.0000001)
pre = (pow(26,d)-26)//25
diff = N - pre
ans = [97 for _ in range(d)]
# print(d, diff)
for i in range(d):
    # print(i, diff)
    # if diff <= 26:
    #     ans += chr(97+diff-1)
    #     break
    if i == d-1:
        ans[i] += diff -1
        break
    if diff % pow(26, d-1-i) == 0:
        x = 25
    else:
        x = diff // pow(26, d-1-i)
    # x = diff//26
    ans[i] += x
    if x == 0 :
        continue
    diff -= x*pow(26, d-1-i)
    # print(x, diff, pow(26, d-1-i))
# print(ans)
for a in ans:
    print(chr(a), end='')

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
alphabets = "abcdefghijklmnopqrstuvwxyz"

index = 1
tot = 0
while(True):
    tot += pow(26,index)
    if(N<=tot):
        break
    index = index+1

output_str = ""

aaaa = 26

temp = 0

for i in range(1,index+1,1):

    temp = (N-temp)%aaaa
    if temp==0:
        temp=aaaa
    temp2 = int(temp/(aaaa/26))

    if i>1:
        temp2+=1
    
    output_str = alphabets[temp2-1] + output_str
    temp = temp+aaaa
    aaaa = aaaa*26

print(output_str)

Submission status: Runtime Error

Solution code:
N = int(input())
n = N
num = 1
str = ''
str_list = 'abcdefghijklmnopqrstuvwxyz'
#str_list = str_list[::-1]
while True:
  if n > 26**num:
    n -= 26 ** num
    num+=1
  else:
    break

for i in reversed(range(num)):
  str += str_list[N // (26**i) - 1]
  N -= 26**i * (N // (26**i))

print(str)

Submission status: Runtime Error

Solution code:
n = int(input())
n = n - 1
ans = []
while n > 0 :
    a = n%26
    n = n//26
    ans.append(chr(a+96))
ans[0] = chr(ord(ans[0]) + 1)
ans = list(reversed(ans))
print("".join(ans))

Submission status: Runtime Error

Solution code:
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[26] + name
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list()
name_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'}
name = ''

while n != 0:
	l.append(n%26)
	n = n//26

for i in reversed(l):
	name += name_dict[i]

print(name)

Submission status: Runtime Error

Solution code:
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 11)]
lis = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())
for b in reversed(bounds):
    if b <= N:
        break
N -= b 
length = bounds.index(b) + 1
s = ''
for i in range(length - 1, 0, -1):
    idx, N = divmod(N, 26**i)
    s = s + lis[idx]
print(s + lis[N])

Submission status: Runtime Error

Solution code:
N=int(input())
num2alpha = lambda c: chr(c+96)

x=[]
while N//26>0:
    x.append(N//26)
    N=N%26
x.append(N)


ans=[]
for i in range(len(x)):
    ans.append(num2alpha(x[i]))

print(''.join(ans))

Submission status: Runtime Error

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

n = int(input())

a_z = string.ascii_lowercase

num_list = []
i = 1

ans = ''

while True:
  if n <= 26 ** i:
    break
  else:
    i += 1

for j in range(i, 0, -1):
  if 1 <= n <= 26:
    num = n
    num_list.append(num)
  else:
    num = n // (26 ** (j - 1))
    num_list.append(num)
  n -= (26 ** (j - 1)) * num

for num in num_list:
  ans += a_z[num - 1]

print(ans)

Submission status: Runtime Error

Solution code:
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    name_roop = []

    level = 1

    ans = ""
    n = 26
    for i in range(10):
        if N > n:
            n += 26**(i+2)
        else:
            break

    for i in range(level, 1, -1):
        count = 0
        a = 26**(i-1)
        for i in range(26):
            if N <= a:
                name_roop.append(count)
                break
            N -= a
            count += 1

    name_roop.append(N)

    for i in name_roop:
        ans += ascii_lowercase[i-1]

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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

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

for i in range(keta-1, -1, -1):
    have = m // (26 ** i)
    ans += alphabet[have-1]
    m -= 26 ** i * have
    
print(ans)

Submission status: Runtime Error

Solution code:
import sys

alpha = 'abcdefghijklmnopqrstuvwxyz'

n = int(input())

i = 0
idx = n
if n > 26:
    while n > 0:
        idx = n
        i += 1
        n = n - 26**i
        # print(i, n)

else:
    print(alpha[n-1])
    sys.exit()

# letter len : i, idx 

def getstr(i, idx):

    if i == 0:
        return ""
    elif i == 1:
        return alpha[idx-1]
    else:
        # number in the range
        t = 26**i

        # number  of bin
        b = int(26 * idx / t)
        idx -= b * int(t/26) 
        i -= 1

        return alpha[b] + getstr(i, idx)

print(getstr(i,idx))

Submission status: Runtime Error

Solution code:
n = int( input() )
 
l = []
a = 97
alp = 26
k = 1
n2 = n
while n >= k + 1:
  l.append( n2 % alp  )
  n2 = ( n2 - n2 % alp ) // alp
  k *= alp
ret = ""
for c in reversed( l ):
  if c == 0:
    ret += "z"
  eles:
    ret += chr( a + c - 1 )
print( ret )

Submission status: Runtime Error

Solution code:
n = int(input())
m = n
for i in range(20):
    tmp = 0
    for j in range(1, i):
        tmp += 26 ** j
    if 26 ** (i - 2) < n <= tmp:
        digit = i - 1
        break
ans = ""
"""
for i in range(digit)[::-1]:
    ans += chr(96 + n // (26 ** i))
    print(n // (26 ** i))
    n = n % (26 ** i)
print(ans)
"""
for i in range(digit)[::-1]:
    m = n // 26 ** i
    if m == 27:
        n -= (m - 1) * 26 ** i
        ans += chr(96 + (m - 1))
    else:
        n -= m * 26 ** i
        ans += chr(96 + m)

print(ans)

Submission status: Runtime Error

Solution code:
import string

n = int(input())

time = 1

while(n > 0):
    n -= pow(26, time)
    time += 1

time -= 1
n += pow(26, time)

alf = string.ascii_lowercase

ans = []

sec = 1
time2 = time
while(time2 > 0):
    index =  n // pow(26, time2-1)
    index2 = n % 26
    n -= pow(26, time2-1)*index
    #print(time-time2, "文字目 : ", alf[index], index2)
    if time2 != 1:
        ans.append(alf[index])
    else:
        ans.append(alf[index-1])

    time2 -= 1

print("".join(ans))

Submission status: Runtime Error

Solution code:
N=int(input())
num2alpha = lambda c: chr(c+96)

x=[]
while N//26>0:
    x.append(N//26)
    N=N%26
x.append(N)
print(x)

ans=[]
for i in range(len(x)):
    ans.append(num2alpha(x[i]))

print(''.join(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
ei="$abcdefghijklmnopqrstuvwxyz"
fla=[]
flaa=[0]
ans=""
cnt=2

for i in range(1,11):
    fla.append(26**i)
    flaa.append(flaa[i-1]+26**i)
for i in range(10):
    if n<=flaa[i]:
        k=i
        break
# print(flaa,k)
if k==1:
    print(ei[n])
    exit()

b=n-flaa[k-1]
# print(b)
while len(ans)!=k-1:
    for i in range(1,27):
        if fla[k-cnt]*i>=b:
            ans+=str(ei[i])
            b-=fla[k-cnt]*(i-1)
            cnt+=1
            # print(b)
            break
ans+=str(ei[b])

print(ans)

Submission status: Runtime Error

Solution code:
import itertools
import string

n = int(input())

max =  1000000000000001
time = 1

while(n > 0):
    n -= pow(26, time)
    time += 1

time -= 1
n += pow(26, time)
#print(n, time)


alf = string.ascii_lowercase

ans = []

sec = 1
time2 = time
while(time2 > 0):
    index =  n // pow(26, time2-1)
    index2 = n % 26
    n -= pow(26, time2-1)*index
    #print(time-time2, "文字目 : ", alf[index], index2)
    if time2 != 1:
        ans.append(alf[index])
    else:
        ans.append(alf[index-1])

    time2 -= 1

print("".join(ans))

Submission status: Runtime Error

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

while True:
  if  26*(26**n-1)/25 > N:
    break
  else:
    n +=1

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


num = [0 for _ in range(n)]
for i in range(n):
  ii = n-i
  for j in range(1,27):
    if 26**(ii-1) * j > N:
      num[i] = alpha[j-2]
      N -= 26**(ii-1) * (j-1)
      break

print(''.join(num))

Submission status: Runtime Error

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

import numpy as np

s = input()

x = np.base_repr(int(s), 26)

strings = {
"1": "a",
"2": "b",
"3": "c",
"4": "d",
"5": "e",
"6": "f",
"7": "g",
"8": "h",
"9": "i",
"A": "j",
"B": "k",
"C": "l",
"D": "m",
"E": "n",
"F": "o",
"G": "p",
"H": "q",
"I": "r",
"J": "s",
"K": "t",
"L": "u",
"M": "v",
"N": "w",
"O": "x",
"P": "y",
"Q": "z"
}

r = ''
for i in list(x):
    r += strings[i]

print(r)

Submission status: Runtime Error

Solution code:
import itertools
import string

n = int(input())

max =  1000000000000001
time = 1

while(n > 0):
    n -= pow(26, time)
    time += 1

time -= 1
n += pow(26, time)
print(n, time)


alf = string.ascii_lowercase

ans = []

sec = 1
time2 = time
while(time2 > 0):
    index =  n // pow(26, time2-1)
    index2 = n % 26
    n -= pow(26, time2-1)*index
    #print(time-time2, "文字目 : ", alf[index], index2)
    if time2 != 1:
        ans.append(alf[index])
    else:
        ans.append(alf[index-1])

    time2 -= 1

print("".join(ans))

Submission status: Runtime Error

Solution code:
LIMIT = 1000000000000001
alphabet = {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())
answer = ""

while True:
    if N >= 27:
        a = int(N / 26)
        b = int(N % 26)
        answer += alphabet[b]
        N = a
    else:
        answer += alphabet[N]
        break

print(answer[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name = name + 'a'
    else:
            if N%26 == 0:
                name = name + alphabet[26]
            else:
                name = name + alphabet[N%26-1]
                N = N//26 +1
print(name)

Submission status: Runtime Error

Solution code:
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 11)]
N = int(input())
for b in reversed(bounds):
    if b <= N:
        break
N -= b 
length = bounds.index(b) + 1
s = ''
for i in range(length - 1, 0, -1):
    idx, N = divmod(N, 26**i)
    s = s + lis[idx]
print(s + lis[N])

Submission status: Runtime Error

Solution code:
n = int(input())
s=[]
alp = [chr(i) for i in range(97, 97+26)]
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())


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


print(num2alpha(n).lower())
z

Submission status: Runtime Error

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

import numpy as np

s = input()

x = np.base_repr(int(s), 26)

strings = {
"1": "a",
"2": "b",
"3": "c",
"4": "d",
"5": "e",
"6": "f",
"7": "g",
"8": "h",
"9": "i",
"A": "j",
"B": "k",
"C": "l",
"D": "m",
"E": "n",
"F": "o",
"G": "p",
"H": "q",
"I": "r",
"J": "s",
"K": "t",
"L": "u",
"M": "v",
"N": "w",
"O": "x",
"P": "y",
"Q": "z"
}

r = ''
for i in list(x):
    r += strings[i]

print(x, r)

Submission status: Runtime Error

Solution code:
n=int(input())
t=0
a=''
al='abcdefghijklmnopqrstuvwxyz'
b=[27]
c=[1]
for i in range(9):
  c.append(c[-1]*26)
  b.append(c[-1]+c[-1]*26)
c.append(c[-1]*26)
b.sort(reverse=True)
b.append(1)
b.append(1)
c.sort(reverse=True)
c.append(1)
flg=0
i=0
while n>0:
  if flg ==1:
    if n > b[i]:
      tmp=0
      while n >= b[i] and tmp <26:
        n -= c[i]
        tmp+=1
      a+=al[tmp-1]
      i+=1
    elif n!=0:
      a+='a'
      i+=1
  elif n > b[i]:
    flg=1
    tmp=0
    while n >= b[i] and tmp <26:
      n -= c[i]
      tmp+=1
    a+=al[tmp-1]
    i+=1
  else:
    i+=1
print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
alphabets = "abcdefghijklmnopqrstuvwxyz"
count = 1
a = 26
while True:
  if n % a == n or n // a == 1:
    break
  a += 1
  a *= 26
  count += 1
ans = ""
for i in range(count):
  a //= 26
  b = n // a
  n = n % a
  ans += alphabets[b - 1]
print(ans)

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,100)]
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))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p-1):
    m = chr(N%26+96)
    if m == '`':
        m = 'a'
    s.append(m)
    N = N//26
s.append(chr(N+96))
s.reverse()
print(''.join(s))

Submission status: Runtime Error

Solution code:
import string

n=int(input())
k = n
a = list(string.ascii_lowercase)
ans = []
for i in range(1000000):
    if k <= pow(26,i):
        tmp = i
        break
    else:
        k -= pow(26,i)
for v in range(tmp):
    tmp2 = n % 26 -1
    n = n//26
    if tmp2 == -1:
        tmp2 = 26
    ans.append(a[tmp2])
ans.reverse()
anss = "".join(ans)
print(anss)

Submission status: Runtime Error

Solution code:
import sys
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
digit=1
check=26
while num > check:
  digit+=1
  check+=26**digit
digit-=1
if digit == 0:
  print(alpha[num-1])
  sys.exit()
ans=[]
while digit > 1:
  ans.append(alpha[num//(26**digit)-1])
  num%=26**digit
  digit-=1
ans.append(alpha[num//26-1])
ans.append(alpha[num%26-1])
print(''.join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
ans = ''
alf = ['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' ]
order = 0
def func(m):
    return 26 * (26**m-1) / 25
# print(func(12))
for i in range(11, 0, -1):
    if n > func(i):
        n = int(n-func(i)+0.5)
        order = i
        break
for i in range(order, 0, -1):
    m = int(n//(26**i) + 0.5)
    # print(n)
    # print(m)
    n %= 26**i
    ans += alf[m]
ans += alf[n-1]
print(ans)

Submission status: Runtime Error

Solution code:

N = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]
alpha = [chr(ord('a') + i) for i in range(26)]
name = []
number = []
a = 1
count = 0

while N//a > 0:
    a = a*26
    count += 1

a = a/26

for i in range(count):
    num = int(N//a)
    number.append(num)
    N = N - num*a
    a = a//26

print(number)

for i in range(count):
    if number[-i] == 0:
        for j in range(count-i-1):
            number[j] -= 1
        del number[0]
print(number)

for i in number:
    name.append(alpha[i-1])

result = "".join(name)
print(result)

Submission status: Runtime Error

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

quo = n
rem = 0

while True:
    rem = quo%26
    quo = quo//26
    if rem == 0:
        ans.insert(0, 'z')
        if quo < 2:
            break
    else:
    
    if quo == 0:
        break

print(*ans, sep="")

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,100)]
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))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p-1):
    m = chr(N%26+96)
    if m == '`':
        m = 'a'
    s.append(m)
    N = N//26
    print(N%26)
s.append(chr(N+96))
s.reverse()
print(''.join(s))

Submission status: Runtime Error

Solution code:
N=int(input())
a=[]
while N!=0:
  if N%26!=0:
    a.append(N%26)
    N=int(N/26)
  else:
    a.append(26)
    N=(N/26)-1
num2alpha = lambda c: chr(c+64)

for i in range(len(a)):
  if i==0:
    name=str.lower(num2alpha(a[len(a)-1]))
  else:
    name+=str.lower(num2alpha(a[len(a)-i-1]))
print(name)

Submission status: Runtime Error

Solution code:
import bisect

alpha_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
  alpha_dict[i+1] = chr(c)


N = int(input())
n = N
l = []
now = 0
i = 1
while now <= 1000000000000001:
  now = 26**i
  l += [now]
  i += 1

cl = l[:]
for i in range(len(l)-1):
  cl[i+1] += cl[i]
i = 0
idx = bisect.bisect_left(cl, N)
ans = ""
while True:
  if N <= 26:
    ans += (alpha_dict[N]).lower()
    break
  N -= l[idx-1]
  a, b = divmod(N, l[idx-1])
  N = b
  idx = bisect.bisect_left(cl, N)
  ans += (alpha_dict[a+1]).lower()
  
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
import sys
import re
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor
sys.setrecursionlimit(1000000)


def main():
    #N, M = map(int, input().split())
    #N, K = map(int, input().split())
    #ps = list(map(int, input().split()))

    N = int(input())

    ds = []
    for n in range(12):
        k = 11 - n
        threshold = sum([26 ** i for i in range(k+1)])
        d = 0
        if N >= threshold:
            d = N // (26 ** k)
            N -= d * (26 ** k)
        ds.append(d)

    chars = 'abcdefghijklmnopqrstuvwxyz'
    result = ''
    for n in range(12):
        if ds[n] > 0:
            result += chars[ds[n]-1]

    print(result)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import string

# 1千兆 + 1
N = int(input())
n_digits = len(str(1000000000000001))
map_letters = { i:v for i,v in enumerate(string.ascii_lowercase)}

x = N - 1
ans = []
for d in range(n_digits):
    if x == 0:
        break
    mod = x % 26
    ans = [ mod ] + ans
    x = x // 26

fa = []
for i in range(len(ans)-1):
    fa.append(ans[i]-1)
fa.append(ans[-1])
print(
    ''.join(map(lambda d: map_letters[d], fa))
)

Submission status: Runtime Error

Solution code:
n = int(input())
A =[chr(i) for i in range(97, 97+26)]
for i in range(1,100):
    if n <= (26 ** i):
        if i == 1:
            print(A[n-1])
        else:
            answer = ''
            for u in range(i-1,0,-1):
                q, mod = divmod(n, (26**u))
            
                answer = answer+A[q]
                n = mod
            answer = answer+A[n-1]
            print(answer)
        break
    else:
        n -= 26 ** i

Submission status: Runtime Error

Solution code:
N = int(input()) 
ret = list()
l = 'abcdefghijklmnopqrstuvwxyz'
while N > 0:
    ret.append(N % 26)
    N //= 26
ans = ''
i = 0
while i < len(ret) - 1:
    ans = l[ret[i]-1] + ans
    i += 1
if ret[-2] != 0:
    ans = l[ret[-1]-1] + ans
else:
    if ret[-1] > 1:
        ans = l[ret[-1]-2] + ans

print(ans)

Submission status: Runtime Error

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def main():
    kazu=[0]
    for i in range(1,13):
        kazu.append(26**i+kazu[i-1])
#    print(kazu)
    n=int(input())
    def hante(a):
        b=0
        for i in range(len(kazu)):
            if a <=kazu[i]:
                b=i
                break
        return b
    keta=[hante(n)]
    ans=[]
    i=keta[0]-1
    while i>=0:
        temp=n//(26**i)
        if temp>0:
            ans.append(temp)
            n-=(26**i)*temp
        else:
            ans.append(n)
            break
        i-=1
    ko = list("abcdefghijklmnopqrstuvwxyz")
    ans2=[]
    for i in ans:
        ans2.append(ko[i-1])
    print("".join(ans2))









if __name__ == "__main__":

    main()

Submission status: Runtime Error

Solution code:
 = int(input())

a = z

txt = ""
num2alpha = lambda c: chr(c+64)

# for i in reversed(range(1,10)):
#     print("a 次数 割る数")
#     print(a,i,26**i)
#     a = (z // (26**i))
#     a0 = (z % (26**i))
    
#     print(a,a0)
#     z = a0
#     if not a ==0:
#         txt += num2alpha(a)
    
#     print(txt)

clip = 0

for i in range(1,10):
    a -= 26**i
    clip += 1
    if a <= 0 :
        break

for i in reversed(range(clip)):
    print(z)
    st = ((z-1) // (26**(i)))
    po = ((z-1) % (26**(i))+1)
    z = po
    print(st,po)
    if i == 0 and po == 1:
        st += po
    if not st == 0:
        txt += num2alpha(st)


print(str.lower(txt))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import string

def solve(N: int):
    alphabet = string.ascii_lowercase
    digits = []
    nextDigits = []
    last = 0
    for i in range(10):
        nd = 26**i + last
        last = nd
        if nd <= N:
            digits.append(nd)
            nextDigits.append(26**i)
        else:
            break
    # print(digits)
    s = ""
    # print(digits)
    for i in range(len(digits)-1,-1,-1):
        isFirstDigit = i == len(digits)-1
        if isFirstDigit:
            currentBaseNum = digits[i]
            index = (N-currentBaseNum)//nextDigits[i]
            s += alphabet[index]
            N = N - currentBaseNum - index * nextDigits[i]
        else:
            index = N //nextDigits[i]
            s+= alphabet[index]
            N = N - index * nextDigits[i]
    return s

# print(solve(26))
# s = ""
# for i in range(1000):
#     s += " " +solve(i)
# print(s)
# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    print(solve(N))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

ascii = 'abcdefghijklmnopqrstuvwxyz'

i = 1
name = ""
while 1:
    # print(i)
    # print(n)
    if n - (26 ** i) > 0:
        n -= 26 ** i
    else:
        while i != 0:
            if i == 1:
                name += ascii[int(n%(26**i))-1]
            else:
                name += ascii[int(n/(26**(i-1)))]
            n = n % (26**(i-1))
            i -= 1
        break
    i += 1
print(name)

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,100)]
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))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p-1):
    if N%26 == 0:
        s.append(chr(97))
    else:
        s.append(chr(N%26+96))
    N = N//26
    print(N%26)
s.append(chr(N+96))
s.reverse()
print(''.join(s))

Submission status: Runtime Error

Solution code:
n = int(input())
#n = 123456789
#strList = [chr(ord('a') + i) for i in range(26)]
strList = ['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']
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:
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401

ALPHABETS: List[str] = list("abcdefghijklmnopqrstuvwxyz")


def sum_exp(a, n):
    return sum([a ** b for b in range(n)])


def main(N):
    M = N

    num_digits = 1
    while True:
        if M / (26 ** num_digits) > 0:
            M -= 26 ** num_digits
            num_digits += 1
        else:
            num_digits -= 1
            break

    P = sum_exp(26, num_digits) - 1
    X = N - P  # X-th number

    a = -1
    d = num_digits
    D: List[int] = []
    for _ in range(num_digits):
        a, b = divmod(X, 26 ** (d - 1))
        D.append(a)
        X = b
        d -= 1
    D[-1] = b - 1

    if num_digits == 1:
        print(ALPHABETS[N - 1])
    else:
        for d in D:
            if d == -1:
                d = 0
            print(ALPHABETS[d], end="")
        print()


if __name__ == "__main__":
    N = int(input())
    main(N)

Submission status: Runtime Error

Solution code:
n=int(input())

b=26

while True:

    if b > n:
        break
    else:
        n -= b
        b*=26

b/=26
while True:
    if n%b == 0:
        print('z',end='')
    elif:
        t = int(n/b)
        print(chr(97+t))
    n = n%b
    b/=26
    if b < 1:
        print()
        break