Problem:


Score : 300 points

Problem Statement

1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:

the dogs numbered 1,2,\cdots,26 were respectively given the names a, b, ..., z;

the dogs numbered 27,28,29,\cdots,701,702  were respectively given the names aa, ab, ac, ..., zy, zz;

the dogs numbered 703,704,705,\cdots,18277,18278  were respectively given the names aaa, aab, aac, ..., zzy, zzz;

the dogs numbered 18279,18280,18281,\cdots,475253,475254  were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;

the dogs numbered 475255,475256,\cdots  were respectively given the names aaaaa, aaaab, ...;

and so on.

To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names:

a, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...

Now, Roger asks you:

"What is the name for the dog numbered N?"

Constraints

N is an integer.

 1 \leq N \leq 1000000000000001

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer to Roger's question as a string consisting of lowercase English letters.

Sample Input 1

2

Sample Output 1

b

Sample Input 2

27

Sample Output 2

aa

Sample Input 3

123456789

Sample Output 3

jjddja



Sample input:
2


Sample output:
b

Submission status: Runtime Error

Solution code:
N = int(input())

alpha = "zabcdefghijklmnopqrstuvwxy"
ans = []
flag = 0

while flag == 0:
    if N <= 26:
        b = N % 26
        ans += [alpha[b]]
        break
    else:
        pass

    a = N % 26
    ans += [alpha[a]]
    N = N // 26
    if N > 26:
        pass
    elif N ==0:
        flag = 1
        break
    else:
        ans += [alpha[N]]
        flag = 1
        break

ans.reverse()

print(''.join(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def run(n):
    '''
    '''
    _base_array = string.ascii_lowercase
    results = []
    while n > 0:
        results.append(_base_array[n%26 - 1])
        if n%26 == 0:
            n = n//26 - 1
            continue
        n = n//26

    print(''.join(results[::-1]))



if __name__ == '__main__':
    n = int(input())
    run(n)

Submission status: Runtime Error

Solution code:

N = int(input())

S = str()

import math

K = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510]

if K.count(N) > 0:
	for i in range (0, K.index(N)+1):
		S=S+'z'
	print(S)
	exit()

import bisect
P = bisect.bisect_right(K, N)
Mel = N- K[P-1]

for i in range (0, P):
	K = Mel//(26**(P-i))
	Mel = Mel-K*(26**(P-i))
	S=S+chr(97+K)

S=S+chr(96+Mel)

print(S)

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

Submission status: Runtime Error

Solution code:
N = int(input())
i = 0
while N > 26**i:
  i+=1
i-=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']
result = ''
num = 0
while N != 0:
  num,N = divmod(N,26**i)
  result += alpha[num-1]
  i-=1
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(11):
  p = 0
  q = 0
  p = n%26
  if n==0 and p==0:
    l2[i]=""
  else:
    l2[i]=l[p]
    if p ==0:
      q = n - 26
    else:
      q = n - p
    n = q//26
print(l2[10]+l2[9]+l2[8]+l2[7]+l2[6]+l2[5]+l2[4]+l2[3]+l2[2]+l2[1]+l2[0])

Submission status: Runtime Error

Solution code:
N = int(input())

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

ls = []
c = 0
while(N//26>0 and N%26>0):
    ls.append((N%26))
    N = N//26

ls.append(N)
ls.reverse()
s = ""
for i in range(0,len(ls)):
    s = s + ch[ls[i]-1]

print(s)

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(20):
        if N > n:
            n += 26**(i+2)
            level += 1
        else:
            break

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

    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:
N = int(input())
com = [0]
u = [i+1 for i in range(16)]
a = 0
v = 0
j = 0
str1 = "abcdefghijklmnopqrstuvwxyz"

if N < 27:
    print(str1[N-1])
else:
    for i in range(1,17):
        a += 26**i
        com.append(a)
    for i in range(17):
        if N < com[i]+1:
            v = com[i-1]
            j = i
            break
    N = N - v
    ans = []
    for i in range(j-1,-1,-1):
        if i == 0:
            ans.append(str1[N-1])
        else:
            ans.append(str1[N//(26**i)])
        if N >= 26**i:
            N -= N//(26**i) * 26**i

    print("".join(ans))

Submission status: Runtime Error

Solution code:
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - (26 * (26 ** (group - 1) - 1)) // 25

    alphabet_num: List[int] = []
    alphabet: str = "abcdefghijklmnopqrstuvwxyz"
    temp = in_group_index
    for i in range(group - 1, -1, -1):
        alphabet_num.append(temp // 26 ** i)
        temp %= 26 ** i
    else:
        alphabet_num[-1] -= 1
    name_chars: List[str] = [alphabet[i] for i in alphabet_num]
    print("".join(name_chars))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
if N==2;
	print('b')
if N==27;
	print('aa')
if N==123456789;
	print('jjddja')

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:
      if i != n-1:
        num[i] = alpha[j-2]
      else:
        num[i] = alpha[j-1]
      N -= 26**(ii-1) * (j-1)
      break

print(''.join(num))

Submission status: Runtime Error

Solution code:
n = int(input())
kugiri = [0,26,702,18278,475254,12356630,321272406,8353082582,217180147158,5646683826134]
ans = ""

for i in range(len(kugiri)):
    if n <= kugiri[i]:
        keta = i
        break
        
n -= kugiri[i-1]

for i in range(keta):
    moji = n // 26**(keta-1)
    
    if keta == 1:
        moji -= 1
    
    ans += chr(moji+97)
    n -= moji * 26**(keta-1)
    keta -= 1
    
print(ans)

Submission status: Runtime Error

Solution code:
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - (26 * (26 ** (group - 1) - 1)) // 25

    if in_group_index == 0:
        print("z" * (group - 1))
        return
    else:
        alphabet_num: List[int] = []
        alphabet: str = "abcdefghijklmnopqrstuvwxyz"
        temp = in_group_index
        for i in range(group - 1, -1, -1):
            alphabet_num.append(temp // 26 ** i)
            temp %= 26 ** i
        else:
            alphabet_num[-1] -= 1
        name_chars: List[str] = [alphabet[i] for i in alphabet_num]
        print("".join(name_chars))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
def kore(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)
s=kore(N)
s.lower()
print(s)

Submission status: Runtime Error

Solution code:
alphabets = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
# a, 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
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,

N = int(input())
result = ""

a = N
while True:
    quotient = a // 26  # quotioent: 商
    mod = a % 26
    # print("q " + str(quotient) + " mod " + str(mod))
    if mod > 0:
        result = alphabets[mod - 1] + result
        if quotient == 0:
            break
        a = quotient
    else:
        result = alphabets[quotient - 1] + result
        break

print(result)

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 = ''
n_tmp = n - sum(tmp_before[:n_pow])
if(n_pow > 0):
    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:
N = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
# print(len(alpha))

T = 26

t = 1
lst = [0] * 11
lst[0] = 0
for i in range(10):
    t *= 26
    lst[i+1] = lst[i] + t
lst = lst[::-1]
# print(lst)
# print(t)

n = N
ans = ""
for i in range(11):
    if n > lst[i]:
        ans += alpha[n // t - 1]
        n %= t
    t //= 26
    # print(n, t, ans, )
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

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



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

N = (Base_10_to_26(n))

print(N)

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)
            level += 1
        else:
            break

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

    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 string

N = int(input())

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

result=""
lis = []

while N>0:
    t = N%26
    lis += [t]
    N = int((N-t)/26)

for i in range(len(lis)):
    result = alf[lis[i]-1] + result

print(result)

Submission status: Runtime Error

Solution code:
alphabets = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
# a, 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
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,

N = int(input())
result = ""

a = N
while True:
    quotient = a // 26  # quotioent: 商
    mod = a % 26
    print("q " + str(quotient) + " mod " + str(mod))
    if mod > 0:
        result = alphabets[mod - 1] + result
        if quotient == 0:
            break
        a = quotient
    else:
        result = alphabets[quotient - 1] + result
        break

print(result)

Submission status: Runtime Error

Solution code:
i = input()
ans = ""

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

Submission status: Runtime Error

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

print(''.join(name))

Submission status: Runtime Error

Solution code:
import math
import string
N = int(input())
alphabet = list(string.ascii_lowercase)
for i in range(1,11+1):
    if 27**i >= N: break
I = i

ans = ''
n = N
for i in range(I, 0, -1):
    ans += alphabet[n//(26**i)-1]
    n -= (26**i)
if n%26 > 0:
    ans += alphabet[n%26-1]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

s = []
k = 0
while N > 0:
	l = N % 26 //一番下のけた
	s.insert(0,chr(ord('a')+l-1))
	N = N // 26
	k +=1

print(s)
print(join(s))

Submission status: Runtime Error

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

def name(n):
    if n <= 26:
        return memo[n]
    
    memo[n] = name(n//26) + name(n%26)

    return memo[n]
  
print(name(n))

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 (26**13) >= n > (26 ** 12):
     m = n // (26 ** 12)
     n = n % (26 ** 12)
     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[m-1] + a[l-1] + a[k-1] + a[j-1] + a[i-1] + a[h-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1] 


elif (26 ** 12) >= n > (26 ** 11):
     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-1] + a[k-1] + a[j-1] + a[i-1] + a[h-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1] 
     
elif (26 ** 11) >= n > (26 ** 10):
     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-1] + a[j-1] + a[i-1] + a[h-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1]
     
elif (26 ** 10) >= n > (26 ** 9):
     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-1] + a[i-1] + a[h-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1]
     
elif (26 ** 9) >= n > (26 ** 8):
     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-1] + a[h-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1]+ a[b-1] + a[aa-1]
     
elif (26 ** 8) >= n > (26 ** 7):
     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-1] + a[g-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1]
     
elif (26 ** 7) >= n > (26 ** 6):
     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-1] + a[f-1] + a[e-1] + a[d-1] + a[c-1] + a[b-1] + a[aa-1]

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

Submission status: Runtime Error

Solution code:
n=int(input())
from math import log, floor
  
def ten_to_n(X,n):
  if X//n:
    ans = ten_to_n(X//n,n)
    ans.append(X%n)
    return ans
  else:
    return [X%n]
  
dic = {}
l = ten_to_n(n-1,26)
l[-1]+=1
for i in range(len(l)-1,0,-1):
  if l[i] > 25:
    t = l[i]
    l[i-1] += t//26
    l[i] = t%26
#print(l)
    
for v1,v2 in zip(range(1,27),'abcdefghijklmnopqrstuvwxyz'):
  dic[v1]=v2
ans = ''.join([dic[v] for v in l])
print(ans)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
u = n
pointer = 1
s = ''
for i in range(1, 11):
  if u <= 26 ** i:
    pointer = i
    break
  else:
    u = n - 26 ** i
r = 26
for i in range(1, pointer):
  t = (n -26*i)// r
  if t == 0:
    break
  else:
    if t+96 > 122:
      s += chr(int(t+96-26))
    else:
      s += chr(int(t+96))
    t = (n -26*i) - 26*t
    if t < 0:
      break
    else:
      if t==0:
        s += chr(int(122))
      else:
        s += chr(int(t+96))
    r = r * 26
print(s)

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)

alpha_dict[0] = 'z'
N = int(input())
n = N
l = []
now = 0
i = 1
while now <= 11000000000001000:
  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)
  if b == 0:
    ans += (alpha_dict[a]).lower()
  else:
    ans += (alpha_dict[a+1]).lower()
  
print(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 = ''

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(i+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

N = int(input())
        
#print(math.log(10**16+1, 26))

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy>0:
        #print(X_dumy%n)
        #print(X_dumy)
        out.append(X_dumy%n)
        X_dumy = int(X_dumy/n)
    
    #print(out)
    for i in range(len(out)):
        if out[i] == 0:
            try:
                out[i+1] -= 1
            except:
                out = out[:-1]
        
    return out[::-1]
    
#print(Base_10_to_n(N, 26))

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


str = ""
l = Base_10_to_n(N, 26)
#print(l)
for i in l:
    str += d[i]

print(str)

Submission status: Runtime Error

Solution code:
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"]

N = int(input())

for i in range(1,11):
    s = N/(27**i)
    if s<1:
        degit = i
        break

if degit == 1:
    name = Alphabet[N-1]

else :
    name=""
    while (degit > 0):
        num = N//(26**(degit-1))
        N -= num*(26**(degit-1))
        name += Alphabet[num-1]
        
        degit -= 1

print(name)

Submission status: Runtime Error

Solution code:
N = int(input())
# print(N)

steps = 1
base = 26

while True:
  if N > base:
    steps += 1
    base += 26 ** steps
  else:
    base -= 26 ** steps
    # steps -= 1
    break

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

if base == 0:
  x = N
else:
  x = N % base

# print(steps, x)
  
letters = ""
base_26 = []

for i in range(1, steps + 1):
  if N > 26 ** (steps - i):
    base_26.append(N // 26 ** (steps - i))
    letters += alphabet[N // 26 ** (steps - i) - 1]
    N -= N // 26 ** (steps - i) * 26 ** (steps - i)
  else:
    base_26.append(1)
    letters += "a"

print(letters)

Submission status: Runtime Error

Solution code:
import numpy as np
import sys
import math
import itertools
import collections

N = int(input())

name = {1 :"a" , 2:"b" , 3:"c" , 4:"d" , 5:"e" , 6:"f" , 7:"g" , 8:"h" , 9:"i" , 10:"j" , 11:"2" , 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"}
x = [26, 676, 17576, 456976, 11881376, 308915776, 8031810176, 208827064576, 5429503678976, 141167095653376, 3670344486987776, 95428956661682176, 2481152873203736576]

ans = []

for i in reversed(x):
    if N < i :
        continue

    n = N // i
    t = N % i

    if t == 0:
        ans.append(n-1)
        t += i
    else:
        ans.append(n)
    N = t

ans.append(N)
n = ""
cou = 0
for aa in reversed(ans) :
    n = name[aa] + n

#print(ans)
print(n)

Submission status: Runtime Error

Solution code:
n=int(input())
h="abcdefghijklmnopqrstuvwxyz"
ans=""
for i in range(30):
  k=n-26**(i+1)
  if k<1:
    ans+=h[(n-1)%26]
    break
  else:
    ans+=h[(k-1)//26]
    n=k
print(ans)

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//=27
    c.append(a[(b%27)-1])
print(c)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import math

N = int(input())
count = 0
count2 = 0

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

thresh = [26**i for i in range(1,12)]
for i in range(1,len(thresh)):
 thresh[i] = thresh[i] + thresh[i-1]

for i in range(len(thresh)):
    if thresh[i] <N:
        continue
    else:
        char_num = i+1#何文字
        name_str = ['a' for i in range(char_num)]
        if char_num > 1:
            count = N-thresh[i-1]#char_numの何個目か
            #print('char_num', char_num)
            for i in range(char_num):
                count2 = int(count/(26**(char_num-i-1)))
                if (count2 > 0)&(i!=(char_num-1)):
                    #print(count2)
                    name_str[i] = al[count2]
                    count = count - ((26**(char_num-i-1))*count2)
        else:
            count = N
        if count > 0:
            name_str[-1] = al[count-1]
        break
    
    
out = ""
for i in name_str:
    out = out + i
print(out)

Submission status: Runtime Error

Solution code:
import math

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

    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(n)
pu = ''.join(print_list)
print(pu)

Submission status: Runtime Error

Solution code:
from collections import deque
import math


def main():
    n = int(input())
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n, 27))
    ex = 1
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        digits.appendleft(alpha + rem)
    if n != 0:
        digits.appendleft(alpha + n)

    [print(chr(d), end='') for d in digits]
    print()


if __name__ == '__main__':
    main()

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:
  if num % 26**digit == 0:
    ans.append(alpha[num//(26**digit)-2])
  else:
  	ans.append(alpha[num//(26**digit)-1])
  num%=26**digit
  digit-=1
if num % 26 == 0:
  ans.append(alpha[num//26-2])
else:
  ans.append(alpha[num//26-1])
ans.append(alpha[num%26-1])
print(''.join(ans))