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:
S = int(input())
Z = 1
A = []
while S > 0:
  if S >= 26**Z + 1:
    S -= 26**Z
    Z += 1
    continue
  else:
    break
B = Z-1
D = Z
Z = 1
while S > 26:
  if S >= Z*(26**B):
    Z +=1
  else:
    C = Z-1
    A.append(C)
    S -= C*(26**B)
    B -= 1
    Z = 1

A.append(S-1)
E = D-len(A)

while Z <= E:
  A.insert(0,0)
  Z += 1

B = ['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']
C = ['a']
for i in A:
  C[0] += B[i]
a = C[0]
print(a[1:])

Submission status: Runtime Error

Solution code:
S = int(input())
Z = 1
A = []
while S > 0:
  if S >= 26**Z:
    S -= 26**Z
    Z += 1
    continue
  else:
    break
B = Z-1
D = Z
Z = 1
while S > 26:
  if S >= Z*(26**B):
    Z +=1
  else:
    C = Z-1
    A.append(C)
    S -= C*(26**B)
    B -= 1
    Z = 1

A.append(S-1)
E = D-len(A)

while F <= E:
  A.insert(0,0)
  F += 1

B = ['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']
C = ['a']
for i in A:
  C[0] += B[i]
a = C[0]
print(a[1:])

Submission status: Runtime Error

Solution code:
N = int(input())
result =[]
while(N>=26):
    result.append(chr(N%26 + 96))
    N = int(N/26)12
result.append(chr(N + 96))
result.reverse()
print(''.join(result))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import sys
input = sys.stdin.readline
import string
import math

alphabet_list = [chr(i) for i in range(96, 97+26)]
def main():
    number = int(input())
    strings = ""
    while True:
        suffix = int(number / (26**int(math.log(number,26))))
        strings += alphabet_list[suffix]
        if number <= 26:
            break
        number -= suffix * (26**int(math.log(number,26)))
    print(strings)
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast_io()  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	fast_io();
	ll t=1; //cin>>t;
	while(t--){
	    ll n,i; cin>>n;
	    vector<char> a(26);
	    for(i=1;i<26;i++)
	        a[i]+=('a'+i-1);
	    a[0]='z';
	    string ans;
	    while(n){
	        ans+=a[n%26];
	        n/=26;
	    }
	    for(i=ans.size()-1;i>=0;i--)
	        cout<<ans[i];
	}
	return 0;
}

Submission status: Runtime Error

Solution code:
def main():
    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']
    #print(len(alphabet))
    ans = ''
    
    i = 1
    length = 1
    while (26 ** (i-1)) + (26 ** i) < n:
        length += 1
        i += 1
        #print(length)
    
    #print(length)
    for j in reversed(range(1, length+1)):
        r = n // 26 **(j-1)
        n -= (26 ** (j - 1))* r
        ans = alphabet[r-1] + ans
        #print(j)
    
    
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import string
n = int(input())
alphabets = string.ascii_lowercase

def to26(n):
  if (int(n/26)):
    return to26(int(n/26), 26) + str(n%26)
  return str(n%26)
tmp = []
ans = []
n = to26(n)
#print(n)
for i in range(len(n)):
  tmp.append(n[i])
#print(tmp)
for j in tmp:
  j = int(j) - 1
  ans.append(alphabets[j])
ans = "".join(ans)#文字列のリストをstringに変換
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
i=0
while True:
    i+=1
    if (26**i-1)/25*26>=n:
        n-=(26**i-1)/25*26
        break
def sisu(n, b):
　if (int(n/b)):
　　return sisu(int(n/b), b) + chr(n%b+65)
　return chr(n%b+65)
aa=sisu(n,26)
aa="a"*(i-len(aa))+aa
print(aa)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ''
while N > 0:
N -= 1
ans += chr(ord('a') + N % 26)
N //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = ''
for i in range(1, 99):
  if N <= 26 ** i:
    N -= 1
    for j in range(i):
      ans += chr(ord('a') + N % 26)
      N //= 26
    break
  else:
    N -= 26 ** i
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())

s = 1
while N > 26 ** s:
    N -= 26 ** s
    s += 1

ans = ""
N -= 1
for i in range(s):
    ans += chr(ord("a") + ord(N % 26))
    N = N // 26

print(ans[::-1])

Submission status: Runtime Error

Solution code:
n=int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"

n_rem = n
ans = ""

while True:
    x = n_rem%26
    if x == 0:
        x = 26
    ans += chars[x]

    n_rem -= x

    if n_rem == 0:
        break

    n_rem //==26

print(ans[::-1])

Submission status: Runtime Error

Solution code:
n = input()
name = ""

while(True):
  i = n % 26
  n = "abcdefghijklmnopqrstuvwxyz"[i]
  name = n + name
  
  n = (n-i) / 26
  if(n==0):
    break
    
print(name)

Submission status: Runtime Error

Solution code:
n=int(input())-1
if n!=0:
    res=[]
    for b in reversed(basis):
        res.append(n//b)
        n=n%b

    ans=[]
    flag=False
    for x in res:
        if x!=0:
            flag=True
        if flag:
            ans.append(chr(ord("a")+x))

    print("".join(ans))
else:
    print("a")

Submission status: Runtime Error

Solution code:
N = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  res += chars[x]
  n_rem -= x
  
  if n_rem == 0:
    break
  n_rem //= 26
print(res[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
while True:
  x = N % 26
  if x == 0:
    x = 26
  res += chars[x]
  n_rem -= x
  
  if n_rem == 0:
    break
  n_rem //= 26
print(res[::-1])

Submission status: Runtime Error

Solution code:
import string
n=int(input())
alp=string.ascii_lowercase
k=1
s=0
lis=[0]
ans=''

for i in range(1,12):
    k*=26
    s += k
    lis.append(s)
    if s >= n:
        break
#print(i,lis)
x=n-lis[-2]

for i in reversed(range(1,i)):
    q,m=divmod(x,26**i)
    #print(x,q,m)
    #print(alp[q])
    ans+=alp[q]
    x=m
#print(x)
#print(alp[x-1])
ans+=alp[x-1]
print(ans)

Submission status: Runtime Error

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

A = ord('a') - 1
n = inp()
if n == 1:
    print(a)
c = 0
while n >= pow(26,c):
    c += 1
res = []
for i in range(c):
    now = c-i-1
    nnn,m = divmod(n,pow(26,now))
    res.append(chr(A + nnn))
    n = m
print(''.join(res))

Submission status: Runtime Error

Solution code:
import bisect
from itertools import accumulate

N=int(input())
alphabet=[chr(i) for i in range(97,97+26)]
num=[26**i for i in range(1,12)]
acc=list(accumulate(num))
ans=""
index=bisect.bisect_left(acc,N)
if index==0:
    ans+=alphabet[N-1]
else:
    N-=acc[index-1]
    while True:
        tmp=N//num[index-1]
        ans+=alphabet[tmp]
        N-=tmp*num[index-1]
        index=bisect.bisect_left(num,N)
        if index==0:
            break
    ans+=alphabet[N-1]
print(ans)

Submission status: Runtime Error

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

for i in reversed(range(13)):
  I=26**i
  if a<I:
    pass
  else:
  	b=a//I
    a=a%I
  ans+=tostring(b)

print(ans+tostring(a))

Submission status: Runtime Error

Solution code:
N=int(input())
N=N-1
a=N
ans=""

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

for i in reversed(range(13)):
  I=26**i
  if a<I:
    pass
  else:
  	b=a//I
    a=a%I
  ans+=tostring(b)

print(ans+tostring(a))

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
N = int(input())
a=list(map(int, input().split()))
Q = int(input())
b=[]
c=[]
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)
def index(lst, e):
    i = bisect_left(lst, e)
    if i == len(lst):
        raise ValueError
    if lst[i] != e:
        raise ValueError
    return i
for i in range(Q):
  first=0
  last = 0
  a.sort()
  if b[i] not in a:
    print(sum(a))
  else:
    last = a.count(b[i])
    first = index(a,b[i])
    del a[first:first+last]
    list_c = [c[i]]*last
    a = a+list_c
    print(sum(a))

Submission status: Runtime Error

Solution code:
n = input()

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

q, mod = divmod(n-1, 26)
print(q, mod)
answer = data[mod]

while q >= 1:
    q, mod = divmod(q-1, 26)
    print(q, mod)
    answer = data[mod] + answer

print(answer)

Submission status: Runtime Error

Solution code:
n=int(input())

ans=[]
while(n!=0):
    m=n%p
    n=n//p
    ans.append(m)

res=list(map(lambda x: chr(ord("a")-1+x),ans))

print("".join(res))

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 = ""
for i in range(10000000):
    num += 26**i
    if num >= n:
        if i != 0:
            for x in range(i-1):
                i -= 1
                p = p + alplis[n//(26**(i))]
                n = n%(26**(i))
        break
print(p+alplis[n % 26])

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 = ""
for i in range(10000000):
    num += 26**i
    if num > n:
        if i != 0:
            for x in range(i-1):
                i -= 1
                p = p + alplis[n//(26**(i))]
                n = n%(26**(i))
        break
print(p+alplis[n % 26])

Submission status: Runtime Error

Solution code:
n=int(input())
def alpha2num(alpha):
    num=0
    for index,item in enumerate(list(alpha)):
        num+=pow(26,len(alpha)-index-1)*(ord(item)-ord("A")+1)
    return num
if 1<=n<=26:
    n=n
    print(alpha2num(n))
elif 27<=n<=702:
    n-=26
    print(alpha2num(n))
elif 703<=n<=18278:
    n-=702
    print(alpha2num(n))
elif 18279<=n<=475254:
    n-=18278
    print(alpha2num(n))
else:
    n-=475254
    print(alpha2num(n))

Submission status: Runtime Error

Solution code:
abc171c
n=int(input())
s=''
while n:
 n-=1
 s+=chr(n%26+97)
 n//=26
print(s[::-1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()

	print(alpha2num(N).upper())


def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('A')+1)
    return num

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
import string
lc = string.ascii_lowercase
n = int(input())

lst = [0]
for i in range(1, 1000):
    tmp = pow(26, i)
    lst.append(tmp)
    if tmp > n:
        break
cum = [lst[0]]
for i in range(1, len(lst)):
    cum.append(cum[-1] + lst[i])
idx = 0
while True:
    if n-1 < cum[idx]:
        break
    idx += 1
num = n - lst[idx-1] - 1
ans = ''
for i in range(idx)[::-1]:
    tmp = pow(26, i)
    if num >= tmp:
        k = num // tmp
        num = num - 26*k
    else:
        k = num
    ans += lc[k]
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

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"]
ans=str()

if n>=26:
    print(alf[n-1])
    exit()

while n >= 26:
    if n%26==0:
        ans += alf[25] 
        n = n//26
    else:
        n,mod = divmod(n,26)
        ans += alf[mod-1]

ans += alf[n-1]

print(ans[::-1])

Submission status: Runtime Error

Solution code:
import string

def main():  
    alphabet = string.ascii_lowercase
    ans = []

    N = int(input())

    if N < 27:
        ans.append(alphabet[N-1])
    else:
        q, mod = divmod(N, 26)

        if mod == 0 and q == 1:
            ans.append('z')
            return ans
        elif mod == 0 and not q == 1 and q <= 27:
            ans.append('z')
            ans.append(alphabet[q-2])
            return ans
        else:
            ans.append(alphabet[mod-1])
            if q <= 27:
                ans.append(alphabet[q-1])

        while q > 27:
            n = q
            q, mod = divmod(n, 26)
            if mod == 0 and q == 1:
                ans.append('z')
                return ans
            elif mod == 0 and not q == 1 and q <= 27:
                ans.append('z')
                ans.append(alphabet[q-1])
                return ans
            else:
                ans.append(alphabet[mod-1])
                if q <= 27:
                    ans.append(alphabet[q-1]) 
    
    return ans

def main_2(): 
    ans = main()

    str_list = reversed(ans)
    mojiretu = ''
    
    for x in str_list:
        mojiretu += x
        
    print(mojiretu)

main_2()

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(2147483647)
N=int(input())
A=[26,702,18278,475254,12356630,321272406,8353082582,217180147158,5646683826134,146813779479510,3817158266467286,95428956661682176]
B=["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=0
for x in range(12):
  if N<=A[x]:
    a=x
    break
for y in range(a):
  b=N//(26**(a-y))
  print(B[b-1],end="")
  N=N-b*(26**(a-y))
print(B[N-1])

Submission status: Runtime Error

Solution code:
N=int(input())
A=[26,702,18278,475254,12356630,321272406,8353082582,217180147158,5646683826134,146813779479510,3817158266467286,95428956661682176]
B=["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=0
for x in range(12):
  if N<=A[x]:
    a=x
    break
for y in range(a):
  b=N//(26**(a-y))
  print(B[b-1],end="")
  N=N-b*(26**(a-y))
print(B[N-1])

Submission status: Runtime Error

Solution code:
N=int(input())
A=[26,702,18278,475254,12356630,321272406,8353082582,217180147158,5646683826134,146813779479510,3817158266467286]
B=["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=0
for x in range(11):
  if N<=A[x]:
    a=x
    break
for y in range(a):
  b=N//(26**(a-y))
  print(B[b-1],end="")
  N=N-b*(26**(a-y))
print(B[N-1])

Submission status: Runtime Error

Solution code:
n = int(input())
list=[0,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
word = []
i = 12
while i>=0:
  x = n//(26**i)
  word.append(x)
  n = n-x*26**i
  i -= 1

while True:
  word = int(''.join(word)).split()
  if 0 in word:
    p = word.index(0)
    word[p-1] = word[p-1]-1 
    word[p] = 26
  else:
    break

h=''
for i in range(len(word)):
  h += list[word[i]]
print(h)

Submission status: Runtime Error

Solution code:
n = int(input())
list=[0,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
word = []
i = 12
while i>=0:
  x = n//(26**i)
  word.append(x)
  n = n-x*26**i
  i -= 1

while True:
  word = int(''.join(word)).split()
  if 0 in word:
    p = word.index(0)
    word[p-1] = word[p-1]-1 
    word[p] = 26
  else:
    break

h=''
for i in range(len(word)):
  h += list[word[i]]
print(h)

Submission status: Runtime Error

Solution code:
import sys
import itertools
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    l = list(itertools.accumulate(list(26**i for i in range(1,12))))
    c = list('abcdefghijklmnopqrstuvwxyz')
    for i in range(11):
        if n <= l[i]:
            ans = ['']*(i+1)
            break
    if i == 0:
        print(c[n-1])
    else:
        n -= l[i-1]
        for j in range(i+1):
            tmp = n // (26**(i-j))
            if j == i:
                tmp -= 1
            ans[j] = c[tmp]
            n -= ((26**(i-j)) * tmp)
        print(''.join(ans))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
s = []
if N <= 26:
  print(a[N-1])
else:
  while True :
    n = N%26
    N = N//26
    s.append(n)
    if N <26 :
      s.append(N)
      break
  s.sort()
  b=[]
  for j in s:
    b.append(a[s[j]-1])
  b="".join(b)
  print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]

n = 1
s = 26
for i in range(1,12):
    if N <= s:
        n = i
        break
    else:
        s += 26**(i+1)
        
s = 0
for i in range(1,n):
    s += 26**i
    
N = N - s - 1
if N == 0:
    Ans = ""
    for _ in range(n):
        Ans += "a"
else:
    while N > 0:
        L.append(N%26)
        N = N//26
    
    Ans = ""
    for x in reversed(L):
        Ans += alphabet[x]
print(Ans)

Submission status: Runtime Error

Solution code:
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
s = []
while True :
  n = N%26
  N = N//26
  s.append(n)
  if N <26 :
    s.append(N)
    break
s.sort()
b=[]
for j in s:
  b.append(a[s[j]-1])
b="".join(b)
print(b)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=''
check='abcdefghijklmnopqrstuvwxyz'
while n!=0:
  n-=1
  ans+=check[n%26]
  n//=26
print(ans[::-1]

Submission status: Runtime Error

Solution code:
p = [pow(26, i) for i in range(17)]
num = [0 for i in range(17)]
chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
for i in range(17):
  if i == 0:
    continue
  if i == 1:
    num[i] = 26
  else:
    num[i] = num[i-1] + p[i]
n = int(input())
ans = ''
l = 0
while n > nums[l]:
  l += 1
x = n - nums[l-1] - 1
for _ in range(l):
  c = chr(ord("a") + x % 26)
  ans = c + ans
  x //= 26
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=""
while n>0:
    n-=1
    ans+=chr(ord('a')+N%26)
    n//=26
    print(ans[::-1])

Submission status: Runtime Error

Solution code:
n=int(input())
ans=""
while N>0:
    n-=1
    ans+=chr(ord('a')+N%26)
    n//=26
    print(ans[::-1])

Submission status: Runtime Error

Solution code:
for _ in range(int(input())):
    n = int(input())
    d = ['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 = ''
    while n:
        n -= 1
        a = d[n % 26] + a
        n //= 26
    print(a)

Submission status: Runtime Error

Solution code:
N=int(input())
ans=''
whileN>0:
  N-=1
  ans+=chr(ord('a')+N%26)
  N//=26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N=int(input())
ans=''
whileN>0:
  N-=15
  ans+=chr(ord('a')+N%26)
  N//=26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
for _ in range(int(input())):
    n = int(input())
    d = ['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']
    a = ''
    f = 0
    if n % 26 == 0:
        f = 1
    while n > f:
        a = d[n % 26] + a
        n //= 26
    print(a)

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

total = 1
for i in range(1,11):
    total += 26**i
    if N < total:
        degit = i
        break
        

#print ("桁数(degit):",i)
N -= (total-26**degit)
#print("N(0から数える数：)",N)

"""
if degit == 1:
    alp = N//(27**(degit-1))
    name = Alphabet[alp]
"""

name = ""
while (degit>0):
    alp = N//(26**(degit-1))
    #print("桁数",degit,"alp:",alp)
    name += Alphabet[alp]
    #print(name)
    N -= alp*(26**(degit-1))
    degit -= 1

print(name)

Submission status: Runtime Error

Solution code:
import math

def convertToChar(num):
   if(num==0):
       return chr(96+26)
   else:
    return chr(96+num)
  
n = int(input())

length = math.ceil(math.log(n-26,26))
s=""
for i in range(length):
    s+=convertToChar((n//26**i)%26)
    
print(s[::-1])

Submission status: Runtime Error

Solution code:
x = n 
nums = []
ans = ''
for i in range(1, 12):
    if 26**i >= n:
        for _ in range(i):
            print(x, x%26)
            x -= 1
            l = x % 26
            x //=  26
            nums.append(l)
        break
    else:
        n -= 26**i
        
for _ in nums:
    ans +=(chr(ord('a') + _))
    
print(ans[::-1])

Submission status: Runtime Error

Solution code:
from collections import *
from operator import mul

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


A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp*(c - b)
    print(A_sum)

Submission status: Runtime Error

Solution code:
import string

n = int(input())
alphabets = string.ascii_lowercase
answer = []
while n >= 1:
	n -= 1
    answer.append(alphabets[n % 26])
    n = n//26
ans = ''.join(list(reversed(answer)))
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
h="abcdefghijklmnopqrstuvwxyz"
ans=""
i=0
a=1
k=n-1
while k//(26**a):
  k-=k//(26**a)
  i+=26**a
  a+=1
n=n-i
for j in reversed(range(a)):
  d=(n-1)//(26**j)
  ans+=h[d]
  n-=d*(26**j)
print(ans)

Submission status: Runtime Error

Solution code:
n = input()
ans = []
while n:
  n, r = divmod(n - 1, 26)
  ans.append(chr(ord('a') + r))
ans.reverse()
print(''.join(ans))

Submission status: Runtime Error

Solution code:
n = input()
ans = []
while n:
  n, r = divmod(n - 1, 26)
  ans.append(chr(ord('a') + r))
ans.reverse()
print(''.join())

Submission status: Runtime Error

Solution code:
def count(N):
    if(N<27):
        return 0
    else:
        N = N//26
        return 1 + count(N)

def check(N,c,ls):
    if (c == 0):
        ls.append(N-1)
        return ls
    else:
        #print("N:",N)
        ls.append((N//(26**c))-1)
        N = N - (26**c)*(N//26**c)
        #print("26**{}".format(c),26**c)
        c -= 1
        return check(N,c,ls)

def check_main(N):
    c = count(N)
    ls = []
    p = check(N,c,ls)
    #print(p)
    s = ""
    for i in range(0,c+1):
        s = s + ch[ls[i]]

    print(s)

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

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ''
for i in range(1, 99):
	if N <= 26 ** i:
	N -= 1
		for j in range(i):
			ans += chr(ord('a') + N % 26)
			N //= 26
		break
	else:
		N -= 26 ** i
print(ans[::-1]) # reversed

Submission status: Runtime Error

Solution code:
def count(N):
    if(N<27):
        return 0
    else:
        N = N//26
        return 1 + count(N)

def check(N,c,ls):
    if (c == 0):
        ls.append(N-1)
        return ls
    else:
        #print("N:",N)
        ls.append((N//(26**c))-1)
        N = N - (26**c)*(N//26**c)
        #print("26**{}".format(c),26**c)
        c -= 1
        return check(N,c,ls)

def check_main(N):
    c = count(N)
    ls = []
    p = check(N,c,ls)
    #print(p)
    s = ""
    for i in range(0,c+1):
        s = s + ch[ls[i]]

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

Submission status: Runtime Error

Solution code:
N = int(input())
mapping = 'zabcdefghijklmnopqrstuvwx'
res = []
for i in range(1, 99):
    if N <= 26 ** i:
        for j in range(i):
            res.append(mapping[N % 26])
            N //= 26
        break
    else:
        N -= 26 ** i
print(''.join(res))

Submission status: Runtime Error

Solution code:
N=int(input());N-=1
a=list('abcdefghijklmnopqrstuvwxyz')
n=[]
def nn(n,x):
    m=n;r=[]
    while 0<m:
        r.insert(0,m%x)
        m=m//x
    r[-1]+=1
    return r
for i in nn(N,26):
    n.append(a[i-1])
print(''.join(n))

Submission status: Runtime Error

Solution code:
N = int(input())
2 ans = ''
3 for i in range(1, 99):
4 if N <= 26 ** i:
5 N -= 1
6 for j in range(i):
7 ans += chr(ord('a') + N % 26)
8 N //= 26
9 break
10 else:
11 N -= 26 ** i
12 print(ans[::-1])

Submission status: Runtime Error

Solution code:
N= int(input())
mylist =[]
while N >26:
    b = N%27
    mylist.append(b)
    N = N//27
mylist.append(N-1)
num = ["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 reversed(mylist):
    ans.append(num[i])
print(''.join(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
l=[26**i for i in range(1,10)]
ans=[]
for i in range(len(l)):
  if n-l[i]<=0:
    if n==l[i]:
      print('z'*(i+1))
      break
    else:
      for j in range(1,i+2):
        div,mod=divmod(n,26**(i+1-j))
        if div==0:
          ans.append(chr(ord('a')+mod-1))
        else:
          ans.append(chr(ord('a')+div-1))
          n=mod
      else:
        print(''.join(ans))
        exit()
  else:
    n-=l[i]

Submission status: Runtime Error

Solution code:
N=int(input())


lista=[chr(i) for i in range(97, 97+26)]
alphlist=[1]
anslist=[]
for i in range(1,12):
    if i==1:
        a=alphlist[i-1]+26**i-1
    else:
        a=alphlist[i-1]+26**i
    alphlist.append(a)

for i in range(12):
    if N<=alphlist[i]:
        keta=i
        break
a=keta
Ni=N
for i in range(a):
    Ni=Ni-sum(alphlist[0:a-i-1])+1
    at=Ni//alphlist[a-i-1]-2
    Ni=Ni-(at+1)*alphlist[a-i-1]
    print(Ni,at)
    anslist.append(lista[at])
print(''.join(anslist))

Submission status: Runtime Error

Solution code:
import string

# 1千兆 + 1
N = int(input())
n_digits = len(str(1000000000000001))
letters = string.ascii_lowercase

x = N
ans = []
# while True:
#     x -= 1
#     mod = x % 26
#     ans = [ mod ] + ans
#     x = x // 26
#     if x <= 0:
#         break

# print(ans)
# print("".join([ letters[v] for v in ans ]))

while True:
    x -= 1
    mod = x % 26
    # div = x // 26
    x = x // 26
    
    ans.append(mod)
    if div == 0:
        break

ans = ans[::-1]
print("".join([ letters[v] for v in ans ]))

Submission status: Runtime Error

Solution code:
import string

# 1千兆 + 1
N = int(input())
n_digits = len(str(1000000000000001))
letters = string.ascii_lowercase

x = N - 1
ans = []
# while True:
#     x -= 1
#     mod = x % 26
#     ans = [ mod ] + ans
#     x = x // 26
#     if x <= 0:
#         break

# print(ans)
# print("".join([ letters[v] for v in ans ]))

while True:
    x -= 1
    mod = x % 26
    # div = x // 26
    x = x // 26
    
    ans.append(mod)
    if div == 0:
        break

ans = ans[::-1]
print("".join([ letters[v] for v in 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(100):
        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 j in range(26):
            if N-a > 26**(i-2):
                N -= a
                count += 1

        name_roop.append(count)

    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())
alpha=list("abcdefghijklmnopqrstuvwxyz")
k=26
l=1
while N-k>0:
  N-=k
  k*=26
  l+=1
ans=["a"]*l
N-=1
i=-1
while N>26:
  a=N%26
  N=N//26
  ans[i]=alpha[a]
  i-=1
ans[i]=alpha[N]
print("".join(ans))