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:
#!/usr/bin/env python
# ---------------------------------------------------------------------------------------!
import os
import sys
from io import BytesIO, IOBase
# from bisect import bisect_left as bl                #c++ lowerbound bl(array,element)
# from bisect import bisect_right as br               #c++ upperbound br(array,element)


# ---------------------------------------MAIN()-----------------------------------------------!
def main():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

    n = int(input())
    ans = ""
    while(n):

        k = n//26
        r = n % 26
        if r == 0:
            a += z
        else:
            ans = chr(ord('a')+r-1)+ans
        n = k
    print(ans)


# -----------------------------------------------------------------------------------------!
# region fastio
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def _init_(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def _init_(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip("\r\n")

# endregion


if __name__ == "__main__":
    main()

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:
def main():
    n = int(input())
    abc = 'abcdefghijklmnopqrstuvwxyz'

    length = 1
    accumulation = 0
    while True:
        if n <= 26 ** length + accumulation:
            break
        else:
            accumulation += 26 ** length
            length += 1


    if length == 1:
        answer = abc[n - 1]

    else:
        lst = []
        for _ in range(length - 1):
             if n % 26 != 0:
                 tmp = n // (26 ** (length - 1))
             else:
                 tmp = (n - 1) // (26 ** (length - 1))

             lst.append(tmp)
             n -= (26 ** (length - 1) * tmp)
             length -= 1

        lst.append(n)

        answer = ''
        for i in range(len(lst)):
            number = lst[i]
            answer += abc[number - 1]


    print(answer)



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    abc = 'abcdefghijklmnopqrstuvwxyz'

    length = 1
    accumulation = 0
    while True:
        if n <= 26 ** length + accumulation:
            break
        else:
            accumulation += 26 ** length
            length += 1


    if length == 1:
        answer = abc[n - 1]

    else:
        lst = []
        for _ in range(length - 1):
             tmp = n // (26 ** (length - 1))
             lst.append(tmp)
             n -= (26 ** (length - 1) * tmp)
             length -= 1

        lst.append(n)

        answer = ''
        for i in range(len(lst)):
            number = lst[i]
            answer += abc[number - 1]


    print(answer)



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:

n = int(input())

alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]

alphabet.insert(0,0)

ans = ''
while n > 0:
    ans += alphabet[n%26]
    n = n//26

print(ans[::-1])

Submission status: Runtime Error

Solution code:
n1 = input()
n = int(n1)
a = "abcdefghijklmnopqrstuvwxyz"
aa = "zabcdefghijklmnopqrstuvwxy"
alist = list(a)
aalist = list(aa)
c, d = 0, 0
name = ""
namelist = []
cnt = 0
while 1:
    cnt += 1
    if n <= (26**(cnt+1)-26)/25:
        break
n -=  (26**(cnt)-26)/25
n = int(n)
while 1:
    c = n//26
    d = n%26
    n = c
    namelist.append(d)
    if n == 0:
        break
for i in range(cnt):
    if len(namelist)==cnt+1:
        name = "z"*cnt
        break
    num = namelist[i]
    if i == 0:
        name = aalist[num]
    else:
        name = alist[num] + name

print(name)

Submission status: Runtime Error

Solution code:
n1 = input("")
n = int(n1)
a = "abcdefghijklmnopqrstuvwxyz"
aa = "zabcdefghijklmnopqrstuvwxy"
alist = list(a)
aalist = list(aa)
c, d = 0, 0
name = ""
namelist = []
cnt = 0
while 1:
    cnt += 1
    if n <= (26**(cnt+1)-26)/25:
        break
n -=  (26**(cnt)-26)/25
n = int(n)
while 1:
    c = n//26
    d = n%26
    n = c
    namelist.append(d)
    if n == 0:
        break
print(namelist)
for i in range(cnt):
    if len(namelist)==cnt+1:
        name = "z"*cnt
        break
    num = namelist[i]
    if i == 0:
        name = aalist[num]
    else:
        name = alist[num] + name

print(name)

Submission status: Runtime Error

Solution code:
n1 = input()
n = int(n1)
a = "abcdefghijklmnopqrstuvwxyz"
aa = "zabcdefghijklmnopqrstuvwxy"
alist = list(a)
aalist = list(aa)
c, d = 0, 0
name = ""
namelist = []
cnt = 0
while 1:
    cnt += 1
    if n <= (26**(cnt+1)-26)/25:
        break
n -=  (26**(cnt)-26)/25
n = int(n)
print(n, cnt)
while 1:
    c = n//26
    d = n%26
    n = c
    namelist.append(d)
    if n == 0:
        break
print(namelist)
for i in range(cnt):
    if len(namelist)==cnt+1:
        name = "z"*cnt
        break
    num = namelist[i]
    if i == 0:
        name = aalist[num]
    else:
        name = alist[num] + name

print(name)

Submission status: Runtime Error

Solution code:
n1 = input()
n = int(n1)
a = "zabcdefghijklmnopqrstuvwxy"
aa = "abcdefghijklmnopqrstuvwxyz"
alist = list(a)
aalist = list(aa)
c, d = 0, 0
name = ""
namelist = []
cnt = 0
while 1:
    cnt += 1
    if n <= (26**(cnt+1)-26)/25:
        break
n -=  (26**(cnt)-26)/25
n = int(n)
while 1:
    c = n//26
    d = n%26
    n = c
    namelist.append(d)
    if n == 0:
        break
for i in range(cnt):
    num = namelist[i]
    name = alist[num] + name
print(name)

Submission status: Runtime Error

Solution code:
N=int(input())
keta=1
a=26
while N>a:
  a*=26
  keta+=1
ans=""
for i in range(keta-1,0,-1):
  a=N//(26**i)-1
  N=N%(26**i)
  ans+=chr(ord('a')+a)
ans+=chr(ord('a')+N//(26**i))
print(ans)

Submission status: Runtime Error

Solution code:
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + Alp[n%b-1]
    return Alp[n%b-1]

a = int(input())
print(base10to(a,26))

Submission status: Runtime Error

Solution code:
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + Alp[n%b-1]
    return Alp[n%b-1]

a, b = map(int, input().split())
print(base10to(a,b))

Submission status: Runtime Error

Solution code:
N = int(input())
N = N - 1
#N = 100
a = []
s = ""

while N != 0:
    a.insert(0, N % 26)
    N = N //26

#print(a)

for i in range(0, len(a)-1):
    a[i] = chr(96+a[i])
    s += a[i]

s += chr(97+a[len(a)-1])

print(s)

Submission status: Runtime Error

Solution code:
n = int(input())

num2alpha = lambda c : chr(c+96)

name = num2alpha(n%26)
n = n/26

while n > 26:
  name += num2alpha(n%26)
  n = n/26

print(name)

Submission status: Runtime Error

Solution code:
n = int(input())

num2alpha = lambda c : chr(c+96)

name = ''

while n < 27:
  name += num2alpha(n%26)
  n = n/26

print(name)

Submission status: Runtime Error

Solution code:
n = int(input())
AL = [chr(ord('a') + i) for i in range(26)]

def number_to_alphabet(n):
    N = n-1
    a = ''
    while True:
        d = N % 26
        a = AL[d]+ a
        if N = 0: break
        N = N//26-1
        if N < 0: break
    return a

print(number_to_alphabet(n))

Submission status: Runtime Error

Solution code:
N=input()

list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
     'q','r','s','t','u','v','w','x','y','z']
i=0
words=''
while 26**i <1000000000000001:
  	q()=N%(26**i)
    for k in range(1,len(list)+1):
      	if q()==k:
          words=words+list[k+1]
    N=N-q()
    i =i+1

print(words)

Submission status: Runtime Error

Solution code:
n = int(input())
chars = 'Xabcdefghijklmnopqrstuvwxyz'
res = ''
while True:
    x = n%26 #最下位の位の文字を求める(係数が26でない最下位の位が余りとして出せる)
    if x == 0:#Xが26のときのみ余り0で対応させるため26に書き換え
        x = 26
    res += chars[x]#文字を正解リストに追加
    n -= x　#xを左辺に持っていって右辺で10の位以上の数値を調べる
    if n == 0 :
        break
    n //= 26 #n-xは必ず26の倍数になっている。(xを移項しているから自明)
    #最下位の位を余りとして扱うために26で割って係数を消している。
print(res[::-1])#resには1の位が一番初めに入っているので、反転させて表示

Submission status: Runtime Error

Solution code:
alphabet = [chr(i) for i in range(97, 97+26)]
n = int(input())
keta = 1
rest = 0
while True:
    if n <= 26 ** keta + rest:
        break
    rest += 26 ** keta
    keta += 1  

ans = ''
for i in range(keta-1,-1,-1):
    # 「26**iをいくつ含むか」をループで求める
    # 必ず1以上含む
    contain = 1
    while True:
        if n < contain * 26**i:
            break
        contain += 1
    contain -= 1
    ans += alphabet[contain-1]
    n -= contain * 26 ** i


print(ans)

Submission status: Runtime Error

Solution code:
alphabet = [chr(i) for i in range(97, 97+26)]
n = int(input())
keta = 1
rest = 0
while True:
    if n <= 26 ** keta + rest:
        break
    rest += 26 ** keta
    keta += 1  
print(keta)
ans = ''
for i in range(keta-1,-1,-1):
    # 「26**iをいくつ含むか」をループで求める
    # 必ず1以上含む
    contain = 1
    while True:
        if n < contain * 26**i:
            break
        contain += 1
    contain -= 1
    ans += alphabet[contain-1]
    n -= contain * 26 ** i


print(ans)

Submission status: Runtime Error

Solution code:
n = 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()
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""

while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  ans += chars[x]
  n_rem -= 26
  if n_rem == 0:
    break
  n_rem //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())

ans = ""
name = []
alphabet = {i+1:chr(ord("a") + i) for i in range(26)}
while N > 0:

    a, r = N//26, N%26
    # print(a,r)
    name.append(r)
    N = N//26

if name[0] == 0:
    name = name[1:]

for i in range(len(name)):
    name[i] = alphabet[name[i]]
print("".join(name[::-1]))

Submission status: Runtime Error

Solution code:
N = int(input())

ans = ""
alphabet = {i+1:chr(ord("a") + i) for i in range(26)}
while N != 0:

    a, r = N//26, N%26
    # print(a,r)
    ans = alphabet[r] + ans
    N = N//26

print(ans)

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

Submission status: Runtime Error

Solution code:
N = int(input(""))
al = [None, "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"]
out = []


def Base_10_to_n(X, n):
    X_dumy = X
    while X_dumy > 0:
        out.append(X_dumy % n)
        X_dumy = int(X_dumy / n)
    return out


ans = ""

for i in range(0, len(Base_10_to_n(N, 26))):
    ans = al[out[i]] + ans

print(ans)

Submission status: Runtime Error

Solution code:
import math
import string

s = int(input())

num_to_alphabet = dict(enumerate(string.ascii_lowercase, 1))


def to_base26(n, power, str_26base=''):
    if n <= 26:
        return str_26base + num_to_alphabet[n]
    else:
        base = n // (26 ** power)
        return num_to_alphabet[base] + to_base26(n - 26 ** power * base, power-1, str_26base)

max_power = int(math.log(s) / math.log(26))
str_26base = to_base26(s, max_power)
print(str_26base)

Submission status: Runtime Error

Solution code:
import math
import string

s = int(input())

num_to_alphabet = dict(enumerate(string.ascii_lowercase, 1))

def to_base26(n, str_26base='', power=None):
    if power is None:
        rate_log = math.log10(n) / math.log10(26)
        power = int(rate_log)
    if n < 26:
        str_26base += num_to_alphabet[n]
        return str_26base
    else:
        float_base = n / (26 ** power)
        base = int(float_base)
        str_26base += num_to_alphabet[base]
        if float_base - base > 0:
            str_26base = to_base26(n - 26 ** power * base, str_26base, power=power-1)
        return str_26base

str_26base = to_base26(s)
print(str_26base)

Submission status: Runtime Error

Solution code:
import math
import string

s = int(input())

num_to_alphabet = dict(enumerate(string.ascii_lowercase, 1))

def to_base26(n, str_26base='', power=None):
    if power is None:
        rate_log = math.log10(n) / math.log10(26)
        power = int(rate_log)
    if n < 26:
        str_26base += num_to_alphabet[n]
        return str_26base
    else:
        float_base = n / (26 ** power)
        base = int(float_base)
        str_26base += num_to_alphabet[base]
        if float_base - base > 0:
            str_26base = to_base26(n - 26 ** power * base, str_26base, power=power-1)
        return str_26base

str_26base = to_base26(s)
print('output: ', str_26base)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
S=0
B=[0]*10**5+1
for i in A:
    S+=i
    B[i]+=1  #Bは要素数管理
Q=int(input())
C=[list(map(int,input().split())) for i in range(Q)]
for i in range(Q):
    S=S+(C[i][1]-C[i][0])*B[C[i][0]]
    B[C[i][1]]+=B[C[i][0]]
    B[C[i][0]]=0
    print(S)

Submission status: Runtime Error

Solution code:
N=int(input())
s=0
for k in range(50):
    if 26**k<N and N<=26**(k+1):
        s=k+1
        break
n=N
G=[]
for i in range(s):
    G.append(n%26)
    n=n//26
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"]
F=[]
for i in range(len(G)):
    F.append(G[-i])
P=[]
for i in range(s):
    P.append(A[F[i]-1])
d=str(P[0])
for i in range(s-1):
    d+=str(P[i+1])
print(d)

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:
a,b = map(float, input().split())
print(int((a*b)))

Submission status: Runtime Error

Solution code:
n = int(input())
ans=''
while(n>0):
     ans+=crd(ord('a')+n%26)
     n //=n
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

ans = ''
while n:
    tmp = (n-1)%26
    ans += chr(ord('a')+tmp)
    n//=26
print(ans[::-1])n=int(input())

ans = ''
while n:
    tmp = (n-1)%26
    ans += chr(ord('a')+tmp)
    n//=26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())

    alp = [0] * 6
    for i in range(6):
        x = 26 ** (5-i)
        alp[i] = N // x
        N = N % x
    ans = ''
    for a in alp:
        if a > 0:
            ans += chr(64+a)
    print(ans.lower())

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
from string import ascii_lowercase
N = int(input())

k = [0, 26]
for i in range(1, 13):
    k.append(26 * (k[i] + 1))

    for i in range(13):
        if k[i] + 1 <= N <= k[i+1]:
            n = N - (k[i] + 1)
            for j in range(i, -1, -1):
                print(ascii_lowercase[(n//26**j) % 26], end="")

Submission status: Runtime Error

Solution code:

from string import ascii_lowercase
N = int(input())
     
k = [0, 26]
for i in range(1, 13):
  k.append(26 * (k[i] + 1))
     
  for i in range(13):
    if k[i] + 1 <= N <= k[i+1]:
      n = N - (k[i] + 1)
     
      for j in range(i, -1, -1):
        print(ascii_lowercase[(n//26**j) % 26], end="")

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:
import string
alphabet = list(string.ascii_lowercase)
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]
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 = 'a'
print(c)

Submission status: Runtime Error

Solution code:
import string
alphabet = list(string.ascii_lowercase)
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]
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 = 'a'
print(c)

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())
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]
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
print(c)

Submission status: Runtime Error

Solution code:
import string
alphabet = list(string.ascii_lowercase)
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]
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
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list("abcdefghijklmnopqrstuvwxyz")
a = 1
while N > 26**a:
    N = N - 26**a
    a += 1

pre = []
for i in reversed(range(1,a)):
    r = N // 26**i
    pre.append(r)
    N = int(N%(26**i))

ans = ''
for i in pre:
    ans += L[i]
print(ans+L[N-1])

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)