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 string

n = int(input())

if n <= 26:
    print(string.ascii_lowercase[n-1])
elif n <= 26 + 26**2:
    n = n - 26
    print(string.ascii_lowercase[n//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3:
    n = n - (26 + 26**2)
    print(string.ascii_lowercase[n//(26**2)] + string.ascii_lowercase[n//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4:
    n = n - (26 + 26**2 + 26**3)
    print(string.ascii_lowercase[n//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5:
    n = n - (26 + 26**2 + 26**3 + 26**4)
    print(string.ascii_lowercase[n//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5)
    print(string.ascii_lowercase[n//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6)
    print(string.ascii_lowercase[n//(26**6)] + string.ascii_lowercase[(n%(26**6))//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7)
    print(string.ascii_lowercase[n//(26**7)] + string.ascii_lowercase[(n%(26**7))//(26**6)] + string.ascii_lowercase[(n%(26**6))//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8)
    print(string.ascii_lowercase[n//(26**8)] + string.ascii_lowercase[(n%(26**8))//(26**7)] + string.ascii_lowercase[(n%(26**7))//(26**6)] + string.ascii_lowercase[(n%(26**6))//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9)
    print(string.ascii_lowercase[n//(26**9)] + string.ascii_lowercase[(n%(26**9))//(26**8)] + string.ascii_lowercase[(n%(26**8))//(26**7)] + string.ascii_lowercase[(n%(26**7))//(26**6)] + string.ascii_lowercase[(n%(26**6))//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])
elif n <= 26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10 + 26**11:
    n = n - (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10)
    print(string.ascii_lowercase[n//(26**10)] + string.ascii_lowercase[(n%(26**10))//(26**9)] + string.ascii_lowercase[(n%(26**9))//(26**8)] + string.ascii_lowercase[(n%(26**8))//(26**7)] + string.ascii_lowercase[(n%(26**7))//(26**6)] + string.ascii_lowercase[(n%(26**6))//(26**5)] + string.ascii_lowercase[(n%(26**5))//(26**4)] + string.ascii_lowercase[(n%(26**4))//(26**3)] + string.ascii_lowercase[(n%(26**3))//(26**2)] + string.ascii_lowercase[(n%(26**2))//26] + string.ascii_lowercase[n%26-1])

Submission status: Runtime Error

Solution code:
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7


ans = []

n = int_input()

while (n > 0):
    quo = n%26
    n = n//26
    //print(n)
    if quo == 0:
        ans.append('z')
    else:
        ans.append(chr(97+quo-1))


ans.reverse()

s = ""

for c in ans:
    s+=c

print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
alplis = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
num = 0
p = alplis[n % 26]
for i in range(10000):
    num += 26**i
    if num > n:
        if i != 0:
            for x in range(i-1):
                i -= 1
                p = alplis[n//(26**(i))] + p
                n = n%(26**(i))
        break
print(p)

Submission status: Runtime Error

Solution code:
from collections import deque
n=int(input())

b=26

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

b/=26

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

Submission status: Runtime Error

Solution code:
import string

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

Submission status: Runtime Error

Solution code:
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / 26 <1:
        p = [chr(n + 96)]
        break
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))
    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))

Submission status: Runtime Error

Solution code:
def alf(st):
  if st == 1:
    return "a"
  if st == 2:
    return "b"
  if st == 3:
    return "c"
  if st == 4:
    return "d"
  if st == 5:
    return "e"
  if st == 6:
    return "f"
  if st == 7:
    return "g"
  if st == 8:
    return "h"
  if st == 9:
    return "i"
  if st == 10:
    return "j"
  if st == 11:
    return "k"
  if st == 12:
    return "l"
  if st == 13:
    return "m"
  if st == 14:
    return "n"
  if st == 15:
    return "o"
  if st == 16:
    return "p"
  if st == 17:
    return "q"
  if st == 18:
    return "r"
  if st == 19:
    return "s"
  if st == 20:
    return "t"
  if st == 21:
    return "u"
  if st == 22:
    return "v"
  if st == 23:
    return "w"
  if st == 24:
    return "x"
  if st == 25:
    return "y"
  if st == 0:
    return "z"
   
N,=list(map(int, input().split()))
li = []
NN = N
count=1
while True:
  li+=[NN%26]
  NN = NN//26
  if NN <26:
    if NN%26!=0:
      li.append(NN%26)
    break
  count+=1
  if count>1000000000000001:
    print("error")
    exit()
#print(li)
for i in range(len(li)-1):
  if li[i]== 0:
    li[i+1]-=1
#print(li)
if(li[len(li)-1])==0:
  li.pop() 
re=[alf(i) for i in li]
re.reverse()
print("".join(re))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'


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


target, index = calc(n, 1)
base26 = [0] * index
for i in range(index):
  tmp, target = divmod(target, 26 ** (index - i - 1))
  if (i == index - 1):
    base26[i] = tmp - 1
  else:
    base26[i] = tmp
ans = ''
for i in base26:
  ans += s[i]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans  = []
cara = ("#","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(10):
  if N <= (-26+26**(i+1))/25:
    keta =  i
    break
for i in range(keta):
  if N //26**(keta-i-2) == 26:
    continue
  if N //26**(keta-i-1) == 27:
    ans.append(26)
    N = N - 26*(26**(keta - i-1))
  else:
    ans.append(N//26**(keta - i-1))
    N = N - (N//26**(keta - i-1))*(26**(keta - i-1))

for i in range(keta):
  print(cara[ans[i]],end="")
print()

Submission status: Runtime Error

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


counter = 0
for i in range(1,13):
    if int(26*(pow(26,i-1))/(26-1)) <= n < int(26*(pow(26,i))/(26-1)):
        counter = i
        break
kekka = n - int(26*(pow(26,counter-1))/(26-1)) + 1
syo = int(kekka/26)
amari = kekka%26

alplist=["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"]

lists = []
i = counter-1
while i>= 0 :
    sho = int(kekka / pow(26,i))
    kekka = kekka - pow(26,i)*sho
    i -=1
    if i >= 0:
        lists.append(alplist[sho])
    else:
        lists.append(alplist[sho-1])


print("".join(lists))

Submission status: Runtime Error

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

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

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import string
n=input(int())
a=[chr(i) for i in range(97,97+26)]
b=n
c=[]
while b>0:
    b=b//27
    d=b%27-1
    c.append(a[(d])
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
ab = ['null','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']
op = ''
startCount = False
for i in [11,10,9,8,7,6,5,4,3,2,1,0]:
    if not startCount:
        upLim = 0
        for j in range(1,i+1):
            upLim += 26**j
    if n >= upLim+1 and not startCount:
        startCount = True
    if startCount:
        op += ab[n//26**i]
        n -= (n//26**i)*26**i
print(op)

Submission status: Runtime Error

Solution code:
n=int(input())
num=[]
t=1
count=1
while n>t*26:
    t *= 26
    n -= t
    count += 1

for i in range(count-1,-1,-1):
    m=26**i
    a=n//m
    n %= m
    num.append(a)
a_list=['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=[]
for i in range(count):
    s=num[i]
    if i==count-1:
        s -= 1
    ans.append(a_list[s])
print(''.join(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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


    counter = 0
    for i in range(1,13):
        if int(26*(pow(26,i-1))/(26-1)) <= n < int(26*(pow(26,i))/(26-1)):
            counter = i
            break
    kekka = n - int(26*(pow(26,counter-1))/(26-1)) + 1
    syo = int(kekka/26)
    amari = kekka%26

    alplist=["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"]

    lists = []
    i = counter-1
    while i>= 0 :
        sho = int(kekka / pow(26,i))
        kekka = kekka - pow(26,i)*sho
        i -=1
        if i >= 0:
            lists.append(alplist[sho])
        else:
            lists.append(alplist[sho-1])


    print("".join(lists))


C()

Submission status: Runtime Error

Solution code:
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))

    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))

Submission status: Runtime Error

Solution code:
num = int(input())
ans = ''
while num > 26:
    num, rest = divmod(num, 26)
    ans += s[rest - 1]
    #print(ans)
ans += s[num - 1]
print(ans[::-1])

Submission status: Runtime Error

Solution code:
import string


n=int(input())
car=""
sum=0
cnt=0
ls=list(string.ascii_lowercase)
while True:
    sum=(sum+1)*26
    cnt+=1
    if sum+1 > n:
        break
for i in range(cnt):
    k=(cnt-1-i)
    car+=ls[n//(26**k)-1]
    n=n%(26**k)
print(car)

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)

    #print(time2, time-time2, "文字目 : ",n,  index ,alf[index], pow(26, time2-1))

    if time2 != 1:
        ans.append(alf[index])
    else:
        #print("first", n , n%26)
        ans.append(alf[n%26-1])

    n -= pow(26, time2-1)*index

    #ans.append(alf[index])

    time2 -= 1

print("".join(ans))

Submission status: Runtime Error

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


if  n >= ((26 ** 12 - 1) / (26 - 1)):
     n = n - ((26 ** 12 - 1) / (26 - 1)) + 1
     l = n // (26 ** 11)
     n = n % (26 ** 11)
     k = n // (26 ** 10)
     n = n % (26 ** 10)
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[l] + a[k] + a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]      

elif n >= ((26 ** 11 - 1) / (26 - 1)):
     n = n - ((26 ** 11 - 1) / (26 - 1)) + 1
     k = n // (26 ** 10)
     n = n % (26 ** 10)
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[k] + a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]      
     
elif n >= ((26 ** 10 - 1) / (26 - 1)):
     n = n - ((26 ** 10 - 1) / (26 - 1)) + 1
     j = n // (26 ** 9)
     n = n % (26 ** 9)
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[j] + a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]      
     
elif n >= ((26 ** 9 - 1) / (26 - 1)):
     n = n - ((26 ** 9- 1) / (26 - 1)) + 1
     i = n // (26 ** 8)
     n = n % (26 ** 8)
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[i] + a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]      
     
elif n >= ((26 ** 8 - 1) / (26 - 1)):
     n = n - ((26 ** 8 - 1) / (26 - 1)) + 1
     h = n // (26 ** 7)
     n = n % (26 ** 7)
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[h] + a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]      
     
elif n >= ((26 ** 7 - 1) / (26 - 1)):
     n = n - ((26 ** 7 - 1) / (26 - 1)) + 1
     g = n // (26 ** 6)
     n = n % (26 ** 6)
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[g] + a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]

elif n >= ((26 ** 6 - 1) / (26 - 1)):
     n = n - ((26 ** 6 - 1) / (26 - 1)) + 1
     f = n // (26 ** 5)
     n = n % (26 ** 5)
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[f] + a[e] + a[d] + a[c] + a[b] + a[aa-1]
     
elif n >= ((26 ** 5 - 1) / (26 - 1)):
     n = n - ((26 ** 5 - 1) / (26 - 1)) + 1
     e = n // (26 ** 4)
     n = n % (26 ** 4)
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[e] + a[d] + a[c] + a[b] + a[aa-1]
     
elif n >= ((26 ** 4 - 1) / (26 - 1)):
     n = n - ((26 ** 4 - 1) / (26 - 1)) + 1
     d = n // (26 ** 3)
     n = n % (26 ** 3)
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[d] + a[c] + a[b] + a[aa-1]
     
elif n >= ((26 ** 3- 1) / (26 - 1)):
     n = n - ((26 ** 3 - 1) / (26 - 1)) + 1
     c = n // (26 ** 2)
     n = n % (26 ** 2)
     b = n // 26
     aa = n % 26
     ans = a[c] + a[b] + a[aa]
     
elif n >= ((26 ** 2 - 1) / (26 - 1)):
     n = n - ((26 ** 2 - 1) / (26 - 1)) + 1
     b = n // 26
     aa = n % 26
     ans = a[b] + a[aa-1]
     
else:
    ans = a[n-1]
    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
N -= 1
alphabets = []
for i in range(26):
    alphabets.append(chr(ord('a') + i))

idx = 1
now = 26
while now <= N:
    now += 26 ** (idx + 1)
    idx += 1
idx -= 1
ans = []
while idx > 0:
    ans.append(alphabets[N // (26 ** idx) - 1])
    N %= 26 ** idx
    idx -= 1
ans.append(alphabets[N])
print(*ans, sep='')

Submission status: Runtime Error

Solution code:
def base_convert(nl, ibase, obase):
    o = []
    while any(nl):
        c = 0
        for i in range(len(nl)):
            c = c * ibase + nl[i]
            nl[i],c = divmod(c,obase)
        o.append(c)
    o.reverse()
    return o

def convertList(lst):
    rev_lst = list(reversed(lst))
    for i,num in enumerate(rev_lst):
        if i < len(rev_lst)-1:
            if num <= 0:
                rev_lst[i+1] = rev_lst[i+1]-1
                rev_lst[i] = rev_lst[i] + 26
    return list(reversed(rev_lst))

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

Submission status: Runtime Error

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

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
tmp_before = [26, 676, 17576, 456976, 11881376, 308915776, 8031810176, 208827064576, 5429503678976, 141167095653376]
tmp = []
s_tmp = 0
for i in range(len(tmp_before)):
    hoge = s_tmp + tmp_before[i]
    tmp.append(hoge)
    s_tmp += tmp_before[i]

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

answer = ''

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

print(answer)

Submission status: Runtime Error

Solution code:
import math

t = input()
moji_list = {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"}
print_list =[]

def hantei(t):
    global print_list
    try:
        int(t)
    except ValueError:
        return
    else:
        n = int(t)
    
    if 1 <= n and n <= 1000000000000001:
        while(n >= 1):
            s = n % 26
            print_list.insert(0, moji_list[s])
            n = math.floor(n / 26)
    else:
        return

hantei(t)
pu = ''.join(print_list)
print(pu)

Submission status: Runtime Error

Solution code:
N=int(input())
X=[chr(ord('a')+i) for i in range(26)]
if N<=26:
    print(X[N-1])
elif N<=702:
    K1=((N-26)//26)
    K2=(((N-26)%26)-1)
    K=X[K1]+X[K2]
    print(K)
elif N<=18278:
    K1=((N-702)//676)
    K2=((N-702)//26)
    K3=((N-702)%26)-1
    K=X[K1]+X[K2]+X[K3]
    print(K)
elif N<=474552:
    K1=((N-18278)//17576)
    K2=((N-18278)//676)
    K3=((N-18278)//26)
    K4=((N-188278)%26)-1
    K=X[K1]+X[K2]+X[K3]+X[K4]
    print(k)
elif N<=12338352:
    K1=((N-474552)//456976)
    K2=((N-474552)//17576)
    K3=((N-474552)//676)
    K4=((N-474552)//26)
    K5=((N-474552)%26)-1
    K=X[K1]+X[K2]+X[K3]+X[K4]+X[K5]
    print(K)
else:
    K1=((N-12338352)//11881376)
    K2=((N-12338352)//456976)
    K3=((N-12338352)//17576)
    K4=((N-12338352)//676)
    K5=((N-12338352)//26)
    K6=((N-12338352)%26)-1
    K=X[K1]+X[K2]+X[K3]+X[K4]+X[K5]+X[K6]
    print(K)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ""
while N > 26:
    N, mod = divmod(N, 26)
    if mod == 0: mod = 26 
    ans += chr(96+mod)
    if N < 27:break
ans += chr(96+mod) 
print(ans[::-1])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
alphabets = 'abcdefghijklmnopqrstuvwxyza'

N = int(input())

for i in range(1,11):
    N = N - (26 ** i)
    if N < 0:
        digit = i
        break

order = N + (26 ** i)

ans = ""

ans = alphabets[order % 26 - 1]
order = order // 26

for i in range(digit - 1):
    print(order % 26)
    ans = (alphabets[order % 26]) + ans
    order = order // 26


print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
l=["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=[]
s=0
for i in range(10):
    s+=26**i
    S=s+26**(i+1)
    if s<=N<S:
        I=i
        break
while I>=0:
    for i in range(1,27):
        n=N-26**I*i
        if n<26**I:
            Ans.append(l[i-1])
            N=n
            I-=1
            break
print("".join(Ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys

N = int(sys.stdin.readline())


def Base_10_to_n(X, n):
    m = chr(X%n+ord("a"))
    if (X//n):
        return Base_10_to_n(X//n-1, n)+m
    return m

print(N)print(Base_10_to_n(N-1,26))

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ""
while N > 26:
    N, mod = divmod(N, 26)
    if mod == 0: mod = 26 
    print(N,mod)
    ans += chr(96+mod)
    if N < 27:break
ans += chr(96+mod) 
print(ans[::-1])

Submission status: Runtime Error

Solution code:
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = math.ceil(math.log((25*N/26)+1,26))
n = N-(26*(26**(k-1)-1)/25)
for i in range(k):
  if i<k-1:
    kre = int(n//(26**(k-1-i)))
    print(Alp[kre], end='')
    n -= (26**(k-1-i))*kre
  else:
    print(Alp[int(n-1)], end='')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections

N = int(sys.stdin.readline())
A = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
Q = int(sys.stdin.readline())
BC = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(Q)) # multi line with multi param
co = collections.Counter(A)
s = sum(A)

for b,c in BC:
    if b in co:
        n = co[b]
        del(co[b])
        co[c] += n
        s += (c-b)*n
    print(s)

Submission status: Runtime Error

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

import numpy as np

s = input()

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

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

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

_index = 0
r = ''
for i in list(x):
    if _index == len(list(x)):
        r += strings[i]
    else:
        r += strings_2[i]
    _index += 1

print(r)

Submission status: Runtime Error

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

n = int(input())

a_z = string.ascii_lowercase

num_list = []
i = 1

ans = ''

tmp = 0

while True:
  tmp += 26 ** i
  if n <= tmp:
    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:
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)
  if j > 0:
    if moji[j-1] == 0:
      moji[j] -= 1

  divn = int(divn/26)
  if divn < 1:
    break

moji.reverse()
text = ""
for m in moji:
  text += chenge_moji(m)

    
print(text)

Submission status: Runtime Error

Solution code:
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = math.ceil(math.log((25*N/26)+1,26))
n = N-(26*(26**(k-1)-1)/25)
for i in range(k):
  if i<k-1:
    kre = int(n//(26**(k-1-i)))
    print(Alp[kre], end='')
    n -= (26**(k-1-i))*kre
  else:
    print(Alp[int(n-1)])

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

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

print(name)