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='0abcdefghijklmnopqrstuvwxyz'
from math import log,ceil
n=int(input())
number_of_digits=ceil(log(n,26))
i=number_of_digits-1
name=''
while n>0:
    o=n//(26**i)
    name+=s[o]
    n=n-o*26**i
    i-=1
print(name)

Submission status: Runtime Error

Solution code:
N=int(input())
i=0
j=1
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']
S=""
while i<N:
    i+=26**j
    j+=1
N-=i-26**(j-1)
for i in reversed(range(j-1)):
    if i!=0:
        a=N//26**i
        S+=l[a]
        N-=a*(26**i)
    else:
        S+=l[N-1]
    if N==0:
        S=S[:len(S)-1]
        S+=l[a-1]
        S+="z"*i
        break
print(S)

Submission status: Runtime Error

Solution code:
N=int(input())
i=0
j=1
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']
S=""
while i<N:
    i+=26**j
    j+=1
N-=i-26**(j-1)
for i in reversed(range(j-1)):
    if i!=0:
        a=N//26**i
        S+=l[a]
        N-=a*(26**i)
    else:
        S+=l[N-1]
print(S)

Submission status: Runtime Error

Solution code:
import copy
n=int(input())
cnt=1
for i in range(100):
    if 26**i>=n:
        cnt=i-1
        break
d=[]
k=copy.deepcopy(n)
for i in range(cnt):
    for j in range(1,27):
        if n<j*26**(cnt-i):
            d.append(j-1)
            n-=(j-1)*26**(cnt-i)
            break
ans=0
for i in range(cnt):
    ans+=d[i]*26**(cnt-i)
d.append(k-ans)
#print(d)
e=[]
for i in range(cnt+1):
    e.append(chr(97+d[i]-1))
#print(e)
print("".join(e))

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26**1)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
else:
    c = "a"
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26**1)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]

print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26**1)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**8):
    c = alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26]+ alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**9):
    c = alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26]+ alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**10):
    c = alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
elif (N//26 < 26**11):
    c = alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**8):
    c = alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26]+ alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**9):
    c = alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26]+ alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**10):
    c = alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
elif (N//26 < 26**11):
    c = alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
elif (N//26 < 26**12):
    c = alphabet[(N//(26**12))-1] + alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
else:
    c = "ERROR"
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] 
    + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] 
    + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**8):
    c = alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26]
    + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**9):
    c = alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26]
    + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**10):
    c = alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] 
    + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26]
    + alphabet[(N-1)%26]
elif (N//26 < 26**11):
    c = alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1]
    + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] 
    + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
elif (N//26 < 26**12):
    c = alphabet[(N//(26**12))-1] + alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] 
    + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] 
    + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
else:
    c = "ERROR"
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N//26 < 1):
    c = alphabet[N-1]
elif (N//26 < 26):
    c = alphabet[(N//26)-1] + alphabet[(N-1)%26]
elif (N//26 < 26**2):
    c = alphabet[(N//(26**2))-1] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**3):
    c = alphabet[(N//(26**3))-1] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**4):
    c = alphabet[(N//(26**4))-1] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**5):
    c = alphabet[(N//(26**5))-1] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (N//26 < 26**6):
    c = alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] 
    + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (C//26 < 26**7):
    c = alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] 
    + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (C//26 < 26**8):
    c = alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26]
    + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (C//26 < 26**9):
    c = alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26]
    + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[(N-1)%26]
elif (C//26 < 26**10):
    c = alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] 
    + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26]
    + alphabet[(N-1)%26]
elif (C//26 < 26**11):
    c = alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] + alphabet[(N//(26**7))-1]
    + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] + alphabet[((N//(26**2))-1)%26] 
    + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
elif (C//26 < 26**12):
    c = alphabet[(N//(26**12))-1] + alphabet[(N//(26**11))-1] + alphabet[(N//(26**10))-1] + alphabet[(N//(26**9))-1] + alphabet[(N//(26**8))-1] 
    + alphabet[(N//(26**7))-1] + alphabet[(N//(26**6))-1] + alphabet[((N//(26**5))-1)%26] + alphabet[((N//(26**4))-1)%26] + alphabet[((N//(26**3))-1)%26] 
    + alphabet[((N//(26**2))-1)%26] + alphabet[((N//26)-1)%26] + alphabet[((N//26)-1)%26]+ alphabet[(N-1)%26]
else:
    c = "ERROR"
print(c)

Submission status: Runtime Error

Solution code:
=int(input())
Al=['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']
s=''
M=[26**i for i in range(12)]
S=[]
k=0
for i in range(11):
    k=k+M[i]
    if N<k:
        m=k-M[i]
        N=N-m
        L=[0]
        n=0
        for j in range(1, i+1):
            L.append(N%M[j])
            s=Al[(L[j]-L[j-1])//M[j-1]]+s
        break
print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
Al=['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']
s=''
L=[]
M=[26**i for i in range(12)]
for i in range(1,12):
    if M[i-1]<=N:
        L.append(N%M[i])
    else:
        l=i
        break
for i in range(l-1):
    if i==0:
        s=s+Al[L[i]]
    else:
        s=Al[(L[i]-L[i-1])//M[i]]+s
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())

S = "abcdefghijklmnopqrstu"

s = ""
while N // 26 > 0:
    s += S[N%26-1]
    N //= 26
s += S[N-1]

print(s[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ""

while num > 0:
	N -= 1
	ans += chr(ord('a') + N % 26)
	N //= 26

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

int main() {
	int a;
	cin>>a;
	string res;

	while (a != 0) {
		int rem=a%26;
		a/=26;
		char asciiChar=rem+97-1;
		res+=asciiChar;
	}

	reverse(res.begin(),res.end());
	cout<<res;
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

// ios::sync_with_stdio(0);
// cin.tie(0);

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

int main() {
	int a;
	cin>>a;
	string res;

	while (a != 0) {
		int rem=a%26;
		a/=26;
		char asciiChar=rem+97-1;
		res+=asciiChar;
	}

	reverse(res.begin(),res.end());
	cout<<res;
}

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  
  for j in range(n):
    if a[j]==b:
      a[j]=c
  print(sum(a))

Submission status: Runtime Error

Solution code:
roman = "abcdefghijklmnopqrstuvwxyz"
num_to_roman = {}
for i in range(26):
  num_to_roman[i+1] = roman[i]

n = int(input())
ans = []
while(n):
  ans.insert(0, num_to_roman[n%26])
  n = n//26
  
ans_str = ''.join(ans)
print(ans_str)

Submission status: Runtime Error

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

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-num//26)//26**i >= 1:
        f = True

    if f:
        ans.append(alf[(num-i)//26**i-1])
        num = num % 26**i
print("".join(ans))

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']
num = int(input())
bit = []
c = (0,0)
i = 0
while (num // 26) > 26 :
    c = divmod(num,26)
    num = c[0] - (i - 1)**26
    bit.append(c[1])
    i+=1
else:
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
if c[0] != 0: bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    res += alphabet[bit[i]]

print(res)

Submission status: Runtime Error

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

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-i*26)//26**i >= 1:
        f = True
    if f:
#            print((num-i)//26**i)
        ans.append(alf[(num-i)//26**i-1])
        num = num % 26**i
print("".join(ans))

Submission status: Runtime Error

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

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-i*26)//26**i >= 1:
        f = True
    if f:
#            print((num-i)//26**i)
        ans.append(alf[(num-i*26)//26**i-1])
        num = num % 26**i
print("".join(ans))

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']
num = int(input())
bit = []
c = (0,0)
while (num // 26) > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
else:
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
if c[0] != 0 or len(bit) == 0: bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
        index = bit[i] - 1
        if index < 0 : index = 0
        res += alphabet[idnex]

print(res)

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']
num = int(input())
if num //26 >= 1 :
  num = num - (1 * (num // 26))
bit = []
c = (0,0)
while (num // 26) > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
else:
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
if c[0] != 0: bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    if i == 0:
        res += alphabet[bit[i]]
    else:
        res += alphabet[bit[i] + 1]

print(res)

Submission status: Runtime Error

Solution code:
N = input()

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)

Submission status: Runtime Error

Solution code:
N = int(input())
 
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0
 
for i in range(1, 1000):
    m += 26**i
    if N <= m:
        n = i
        break

for i in reversed(range(n)):
    a, b = divmod(N, 26**i)
    N = b
    if not a == 0:
      ans += s[a-1]
    else:
      ans += s[25]

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
 
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0
 
for i in range(1, 1000):
    m += 26**i
    if N <= m:
        n = i -1
        break

for i in reversed(range(n)):
    a, b = divmod(N, 26**i)
    N = b
    if not a ==0:
      ans += s[a-1]
    else:
      ans += s[25]

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
M, n, m = 0, 0, 0

for i in range(1, 1000):
    m += 26**i
    if N <= m:
        M = N + 26**i -m
        n = i - 1
        break

for i in reversed(range(n + 1)):
    a, b = divmod(M, 26**i)
    M = b
    if i == 0:
        ans += s[a-1]
    else:
        ans += s[a]

print(ans)

Submission status: Runtime Error

Solution code:
N = input()

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
M, n, m = 0, 0, 0

for i in range(1, 1000):
    m += 26**i
    if N <= m:
        M = N + 26**i -m
        n = i - 1
        break

for i in reversed(range(n + 1)):
    a, b = divmod(M, 26**i)
    M = b
    if i == 0:
        ans += s[a-1]
    else:
        ans += s[a]

print(ans)

Submission status: Runtime Error

Solution code:
N = input()
 
s = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""
M,n = 0,0

for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N + 26**i　- m
    n = i-1
    break

for i in reversed(range(n+1)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + s[a]

print(ans)

Submission status: Runtime Error

Solution code:
N = map(int, input())
 
s = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""
 
for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N + 26**i　- m
    n = i-1
    break

for i in reversed(range(n)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + s[a]

print(ans)

Submission status: Runtime Error

Solution code:
N = map(int, input())

C = "abcdefghijklmnopqrstuvwxyz"
m = 0
ans = ""

for i in range(1,1000):
  m += 26**i
  if N <= m:
    M = N - m + 26**i
    n = i-1
    break

for i in revesed(range(n)):
  a, b = divmod(M, 26**i)
  M = b
  ans = ans + C[a]

print(ans)

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']
num = int(input())
num = num - len(num) + 1
bit = []
c = (0,0)
while (num // 26) > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
else:
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
if c[0] != 0: bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    
    res += alphabet[bit[i] - 1]

print(res)

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']
num = int(input())
bit = []
c = divmod(num,26)
num = c[0]
bit.append(c[1])
while (num // 26) > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
if c[0] != 0: bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    res += alphabet[bit[i] - 1]

print(res)

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']
num = int(input())
bit = []
c = divmod(num,26)
num = c[0]
if c[0] != 0 : bit.append(c[1])
while num // 26 > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    res += alphabet[bit[i] - 1]

print(res)

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']
num = int(input())
bit = []
c = divmod(num,26)
num = c[0]
bit.append(c[1])
while num // 26 > 26 :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
bit.append(c[0])
res = ''
for i in reversed(range(0,len(bit))):
    res += alphabet[bit[i] - 1]

print(res)

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']
num = int(input())
bit = []
while true :
    c = divmod(num,26)
    num = c[0]
    bit.append(c[1])
    if num < 26 : 
        bit.append(c[0])
        break
res = ''
for i in reversed(range(0,len(bit))):
    res += alphabet[bit[i] - 1]

print(res)

Submission status: Runtime Error

Solution code:
n = int(input())

m = {}
for i in range(1,27):
  m[i] = chr(96+i)

ans = ''
while 1:
  x = n // 26
  y = n % 26

  ans = m[y] + ans
  
  if x == 0:
    break
  else:
    n = n // 26

print(ans)

Submission status: Runtime Error

Solution code:
def solve():
  N = int(input())
  k = 1
  while N>pow(26,k):
    N -= pow(26,k)
    k += 1
  ans = ''
  N -= 1
  for i in range(k,1,-1):
    ans += chr(ord('a')+N//pow(26,i-1))
    N%=pow(26,i-1)
  ans += chr(ord('a')+N%pow(26,i))
  return ans
print(solve())

Submission status: Runtime Error

Solution code:
s = raw_input()
n = int(s)
dd = 'abcdefghijklmnopqrstuvwxyz'

def main():
	if n == 1:
		print 'a'

	ret = ''
	while n > 1:
		d = (n-1)%26
		n = n//26
		ret += dd[d]
	print ret[::-1]

main()

Submission status: Runtime Error

Solution code:
s = raw_input()
n = int(s)
dd = 'abcdefghijklmnopqrstuvwxyz'

if n == 1:
	print 'a'
	return

ret = ''
while n > 1:
	d = (n-1)%26
	n = n//26
	ret += dd[d]
print ret[::-1]

Submission status: Runtime Error

Solution code:

local t = {"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"}
local N = io.read()
local N = 123456789
local x = string.byte("a") - 1
local aa = ""
local function a(N)
    local n = math.floor(N / 26)
    local m = N % 26
    if n > 26 then
       a(n)
    else
        if m ~= 0 then
            aa = aa..t[n]
        end
    end
    if m == 0 then
        aa = aa..t[26]
    else
        aa = aa..t[m]
    end
end
a(N)
print(aa)

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())
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:
from collections import defaultdict
input()
a = [*map(int, input().split())]
s = sum(a)
b = [[*map(int,input().split())] for _ in range(int(input()))]
c = defaultdict(int)
for i in a:
    c[i]+=1
for i,j in b:
    s += (j-i)*c[i]
    c[j]+=c[i]
    c[i] = 0
    print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
q = [0]*12
i = 10
n = N
cflag = 0
str = []
while i != -1:
    q[i] = n // 26 ** i
    mod = n % 26 ** i
    n = mod
    i -= 1
for i in range(12):
    if q[i] == 0 and q[i+1] == 0:
        break
    elif q[i] == 0:
        str.append("z")
        cflag = 1
    elif q[i] == 1 and q[i+1] == 0 and cflag == 1:
        break
    elif q[i] == 1 and cflag == 1:
        str.append ("z")
    else:
        str.append(chr(q[i] + 96 -cflag))
        cflag = 0

i = len(str) -1
while i >= 0:
    if[str] == '':
        i-=1
        continue
    elif i == 0:
        print(str[i])
        break
    else:
        print(str[i], end="")
        i -= 1

Submission status: Runtime Error

Solution code:
N = int(input())
q = [0]*11
i = 10
n = N
cflag = 0
str = []
while i != -1:
    q[i] = n // 26 ** i
    mod = n % 26 ** i
    n = mod
    i -= 1
for i in range(11):
    if q[i] == 0 and q[i+1] == 0:
        break
    elif q[i] == 0:
        str.append("z")
        cflag = 1
    elif q[i] == 1 and q[i+1] == 0 and cflag == 1:
        break
    elif q[i] == 1 and cflag == 1:
        str.append ("z")
    else:
        str.append(chr(q[i] + 96 -cflag))
        cflag = 0

i = len(str) -1
while i >= 0:
    if[str] == '':
        i-=1
        continue
    elif i == 0:
        print(str[i])
        break
    else:
        print(str[i], end="")
        i -= 1