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: Wrong Answer

Solution code:
N = int(input())
i = 10
ans = []
if N > 26**10 + 26**9 + 26**8 + 26**7 +26**6 + 26**5 + 26**4 + 26**3 + 26**2 + 26:
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**9 + 26**8 + 26**7 +26**6 + 26**5 + 26**4 + 26**3 + 26**2 + 26:
    i = 9
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**8 + 26**7 +26**6 + 26**5 + 26**4 + 26**3 + 26**2 + 26:
    i = 8
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**7 +26**6 + 26**5 + 26**4 + 26**3 + 26**2 + 26 :
    i = 7
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**6 + 26**5 + 26**4 + 26**3 + 26**2 + 26:
    i = 6
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**5 + 26**4 + 26**3 + 26**2 + 26:
    i = 5
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**4 + 26**3 + 26**2 + 26:
    i = 4
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        if x == 'a':
                            x = ans[i-5]
                            ans[i-5] = chr(ord(x)-1)
                            ans[i-4] = 'z'
                            ans[i-5] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] == 'z'
                            ans[i] == 'z'
                        else:
                            ans[i-4] = chr(ord(x)-1)
                            ans[i-3] = 'z'
                            ans[i-2] = 'z'
                            ans[i-1] = 'z'
                            ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**3 + 26**2 + 26:
    i = 3
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        ans[i-4] = chr(ord(x)-1)
                        ans[i-3] = 'z'
                        ans[i-2] = 'z'
                        ans[i-1] = 'z'
                        ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**2 + 26:
    i = 2
    while i >= 0:
        a = int(N / 26**i)
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                if x == 'a':
                    x = ans[i-3]
                    if x == 'a':
                        x = ans[i-4]
                        ans[i-4] = chr(ord(x)-1)
                        ans[i-3] = 'z'
                        ans[i-2] = 'z'
                        ans[i-1] = 'z'
                        ans[i] == 'z'
                    ans[i-3] = chr(ord(x)-1)
                    ans[i-2] = 'z'
                    ans[i-1] = 'z'
                    ans[i] = 'z'
                else:
                    ans[i-2] = chr(ord(x)-1)
                    ans[i-1] = 'z'
                    ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26**1:
    i = 1
    while i >= 0:
        a = int(N / 26**i) 
        if a > 26:
            a = 26
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    for i in range(len(ans)):
        if ans[i] == '`':
            x = ans[i-1]
            if x == 'a':
                x = ans[i-2]
                ans[i-2] = chr(ord(x)-1)
                ans[i-1] = 'z'
                ans[i] = 'z'
            else:
                ans[i-1] = chr(ord(x)-1)
                ans[i] = 'z'
    print(''.join(ans))
elif N > 26*0:
    i = 0
    while i >= 0:
        a = int(N / 26**i)
        ans.append(chr(96+a))
        N -= a*26**i
        i -= 1
    print(''.join(ans))

Submission status: Wrong Answer

Solution code:
from collections import deque
from math import log
def main():
    n = int(input())
    on = n
    keta = log(n, 26)
    c = deque()
    cnt = 1
    ke = n % 26
    while n > 0:
        t = n // (26 ** cnt)
        t = t % 26
        c.appendleft(t)
        n -= 26 ** cnt
        cnt += 1
        if 26 ** (cnt) > on:
            break
    c.append(ke)
    cs = []
    #del c[0]
    for ce in c:
        ce += 96
        cec = chr(ce)
        cs.append(cec)
    print("".join(cs))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import itertools
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
data = ''
count = 1
data = f'{data}{a[N % 26-1]}'
if int(N/26) == 0:
    print(data[0])
    exit(0)
if N%26 == 0 and N/26 == 1:
    print(data)
    exit(0)
for i in range(int(math.log(N, 26))):
    if int(math.log(N, 26)) != i:
        data = f'{a[round((N/26**count) % 26)-1]}{data}'
    else:
        data = f'{a[round((N/26**count) % 26)-2]}{data}'
    N -= 26**count
    count += 1
print(data)
exit(0)

Submission status: Wrong Answer

Solution code:
a = int(input().rstrip())
 
b = a
c = []
for i in range(30):
    c.append(int(b%26))
    b = b/26
c.reverse()
 
aa = ["","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 j in range(len(c)):
    print(aa[c[j]],end ="")
print("")

Submission status: Wrong Answer

Solution code:
import math
import re
N=int(input())
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+','+str(X%n)
    return str(X%n)
x26 = Base_10_to_n(N, 26)
#print(x26)
c=1
ayu=1
for i in range (12):
  ayu=str(ayu)+',0'
  if (x26==ayu):
    print('z'*c)
    exit()
  c=c+1
#print(x26[-1])

x26=(re.sub('0,', '', x26))
print(x26)
x26=list(map(int,x26.split(',')))
#print(x26)
size = len(x26)
c=0
for i in range(size):
  ans=x26[c]
  c+=1
  if (chr(96+int(ans))=='`'):
    print('')
    continue
  print(chr(96+int(ans)), end='')

Submission status: Wrong Answer

Solution code:
def base(n, b):
    s = []
    p = abs(n)
    while p:
        s.append(p % b)
        p //= b
    alp = "abcdefghijklmnopqrstuvwxyz"
    r=''
    first = True
    for a in s:
        if first:
            r+=alp[a]
        else:
            r += alp[a-1]
        first = False
    ret  =''.join(list(reversed(r)))
    if ret.startswith('az'):
        ret.replace('az','z')
    return ret


n = int(input(''))-1
print("{}".format(base(n,26)))

Submission status: Wrong Answer

Solution code:
N = int(input())
alplha = ['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']
l = len(alplha)
ans = ""
ljou = [1]
a = 26
s= 0
for k in range(10000):
    s += a
    if s > N:
        break
    else:
        ljou.append(a)
        a = a*l

for k in range(1, len(ljou)+1):
    ans += alplha[(N//ljou[-k])-1]
    N = N%ljou[-k]
#print(N)
#ans += alplha[N]
print(ans.replace('aa', 'z'))

Submission status: Wrong Answer

Solution code:

import math

import numpy

n = int(input())

x = int(math.log(n,26))

s = list("abcdefghijklmnopqrstuvwxyz")

t = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P']

y = int(math.log(n,26))

q = 0
        
if q == 0:
    for i in reversed(range(y+1)):
        v = int(n//(26**i))
        print(s[v-1],end = "")
        n -= v*(26**i)

Submission status: Wrong Answer

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

leng = int(math.log(n, 26))
org = leng
res = []
for i in reversed(range(leng)):
    leng = int(math.log(n, 26))
    num = n // 26**leng
    dum = n % 26**leng
    if dum == 0:
        res = []
        for i in range(org):            
            res.append('z')
    else:
        res.append(chr(96+num))
        n -= 26**leng*num

if n%26 != 0:
    res.append(chr(96+n%26))

print(''.join(res))

Submission status: Wrong Answer

Solution code:
N= int(input())
if N ==0:
    print("a")
else:   
    mylist =[]
    while N >26:
        b = N%26
        mylist.append(b-1)
        N = N//26
    if N ==26:
        mylist.append(25)
    else:
        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: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = [26**i for i in range(1,100)]
A = [0]+list(itertools.accumulate(A))
cnt = 0
if N == 1:
    print('a')
    exit()
for i in range(N):
    if A[i] >= N:
        p = cnt
        break
    cnt += 1
if p == 1:
    print(chr(N+96))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p):
    m = chr(N%27+97)
    if m == '`':
        m = 'z'
    s.append(m)
    N = N//27
s.reverse()
print(''.join(s))
#muri

Submission status: Wrong Answer

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

n = int(input())
d = {y: x for x, y in zip("abcdefghijklmnopqrstuvwxyz", range(1, 27))}

res = []
print(Base_10_to_n(n, 26))
array = Base_10_to_n(n, 26)
for index in range(len(array)):
    a = array[index]
    if a == 0:
        res.append("z")
        array[index] = 26
        if index + 1 >= len(array):continue
        array[index+1] = 0

print("".join([d[x] for x in array[::-1]]))

Submission status: Wrong Answer

Solution code:
N = int(input())
name = ''
i = 1
a = 26
while True:
    if N <= a:
        break
    i += 1
    a = 26**i
keta = i - 1
while N != 0:
    num = N // 26**keta
    name += chr(num + 96)
    N = N % 26**keta
    keta -= 1
print(name)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[chr(ord('a') + i) for i in range(26)]
l=[]
cnt=0
inc=1
while True:
  cnt+=26**inc
  if cnt>=n:
    #print(inc)
    break
  inc+=1
s=0
if n<=26:
  l.append(n)
for i in range(inc-1,0,-1):
  #print('i',i)
  x=n//26**(i)
  l.append(x)
  n=n-x*26**i
  #print("n",n,x)
  if n<=26:
    l.append(n)

ans=""
print(l)
for li in l:
  if li==0:
    li=26
  ans+=chr(ord('a') + li-1)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    start = 0
    cnt = 0
    while 1:
        start += 26 ** cnt
        if start > n:
            start -= 26 ** cnt
            break
        cnt += 1
    ans = ''
    tmp = n
    for i in range(cnt - 1, -1, -1):
        shou = tmp // (26 ** i)
        tmp = tmp % (26 ** i)
        if tmp == 0 and i != 1:
            ans += 'z'
            continue
        if shou:
            ans += chr(ord('a') + shou - 1)
        else:
            ans += chr(ord('a') + tmp)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ""
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
if n <= 26:
    print(alphabet[n - 1])
else:
    a = 0
    while True:
        a = n%26
        n = n // 26
        if a == 1:
            if (n - 1) % 26 == 0:
                ans += "z" 
            else:
                ans += alphabet[a - 1]
        else:
            ans += alphabet[a - 1]
        if n <= 26:
            ans += alphabet[n - 1]
            ans = ans[::-1]
            print(ans)
            break

Submission status: Wrong Answer

Solution code:
import copy

bs = [26**i for i in range(0, 20)]
""" pull up """
for i in range(1, len(bs)):
    bs[i] += bs[i-1]
# print(bs)

def dec_wac(num, params):
    rs = []
    f = False
    for d, p in reversed(params):
        r = num//(26**d)
        # print(p, r, num)
        if r == 27:
            rs.append(26)
            num -= r*(26**d)
            f = True
        elif f and r == 1:
            rs.append(26)
            num -= r*(26**d)
        else:
            rs.append(r)
            num -= r*(26**d)
            f = False
    return rs

def loop(num):
    """ calc max """
    a = [(idx,b) for idx, b in enumerate(bs) if b <= num]
    # print(a)
    k_num = num - a[-1][1]
    params = [(d,kn) for d, kn in a]
    #print(k_num, params, dec_wac(num, params))
    return dec_wac(num, params)

cs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ".lower())

a = "".join([cs[i-1] for i in loop(int(input()))])
print(a)

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [1]
p = 1
while a[-1] <= 1000000000000001:
    a.append(26**p)
    p += 1
l = 0
a_sum = a[0]
while n > a_sum:
    l += 1
    a_sum += a[l]
s = [chr(i) for i in range(97, 97+26)]
ans = ''
while l >= 1:
    b = n // a[l]
    c = n % a[l]
    if c == 0:
        b -= 1
        c = 26
        ans = ans + s[b-1]
        n = c
    else:
        ans = ans + s[b-1]
        n = c
    l -= 1
ans = ans + s[n-1]
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a=[chr(i) for i in range(97, 97+26)]
N=int(input())
if N<=26:
    print(a[N-1])
elif 26<N<=26**2+26:
    print(a[math.floor((N-1)/26)-1]+a[(N-1)%26])
elif 26**2-26<N<=26**3+26**2+26:
    print(a[math.floor((N-1)/(26**2+26))-1]+a[math.floor((N-1/26))%(26)]+a[(N-1)%26])
       
elif 26**3+26**2+26<N<=26**4+26**3+26**2+26:
    print(a[math.floor((N-1)/(26**3+26**2+26))-1]+a[math.floor(N/(26**2+26)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
    
elif 26**4+26**3+26**2+26<N<=26**5+26**4+26**3+26**2+26:
     print(a[math.floor((N-1)/(26**4+26**3+26**2+26))-1]+a[math.floor(N/(26**3+26**2+26)-1)%26]+a[math.floor(N/(26**2+26)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**5+26**4+26**3+26**2+26<N<=26**6+26**5+26**4+26**3+26**2+26:
     print(a[math.floor((N-1)/(26**5+26**4+26**3+26**2+26))-1]+a[math.floor(N/(26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**3+26**2+26)-1)%26]+a[math.floor(N/(26**2+26)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**6+26**5+26**4+26**3+26**2+26<N<=26**7+26**6+26**5+26**4+26**3+26**2+26:
     print(a[math.floor((N-1)/(26**6+26**5+26**4+26**3+26**2+26))-1]+a[math.floor(N/(26**5+26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**3+26**2+26)-1)%26]+a[math.floor(N/(26**2+26)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**7+26**6+26**5+26**4+26**3+26**2+26<N<=26**8+26**7+26**6+26**5+26**4+26**3+26**2+26:
    print(a[math.floor((N-1)/(26**7+26**6+26**5+26**4+26**3+26**2+26))-1]+a[math.floor(N/(26**6+26**5+26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**5+26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**4+26**3+26**2+26)-1)%26]+a[math.floor(N/(26**3+26**2+26)-1)%26]+a[math.floor(N/(26**2+26)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**8+26**7+26**6+26**5+26**4+26**3+26**2+26<N<=26**9+26**8+26**7+26**6+26**5+26**4+26**3+26**2+26:
    print(a[math.floor((N-1)/(26**8))-1]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**9+26**8+26**7+26**6+26**5+26**4+26**3+26**2+26<N<=26**10+26**9+26**8+26**7+26**6+26**5+26**4+26**3+26**2+26:
    print(a[math.floor((N-1)/(26**9))-1]+a[math.floor(N/(26**8)-1)%26]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
else:
    if N<=1000000000000001:
         print(a[math.floor(N/(26**10))-1]+a[math.floor(N/(26**9)-1)%26]+a[math.floor(N/(26**8)-1)%26]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])

Submission status: Wrong Answer

Solution code:
import math

n = (int)(input())
remain = []
while n > 0:
    re = n % 26
    remain.append(re)
    n = math.floor(n / 26)

remain.reverse()

ret = ""
for i in remain:
    if chr(i + 96) != "`":
        ret += chr(i + 96)

print("{}".format(ret))

Submission status: Wrong Answer

Solution code:
abc=['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=""
n=int(input())
for i in range(0, 11):
    if int(n//(26**(i+1)))>=2:
        S+=abc[((n- (n//(26**(i+1))*(26**(i+1))) )//(26**i))]
        n-=(n- (n//(26**(i+1))*(26**(i+1))) )//(26**i)
    else:
        S+=abc[((n-(n//(26**(i+1))*(26**(i+1))))//(26**i))-1]
        break
        
print(S[::-1])

Submission status: Wrong Answer

Solution code:
MAX = 1000000000000001
n = int(input())

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

  
buffer = 1
cutlist = []
while True :
  buffer *= 26
  cutlist.append(buffer)
  buffer += 1
  if(buffer > MAX):
    break
target = 0
for i in range(len(cutlist)):
  if n/cutlist[i] <= 1:
    target= i
    break

moji = []
divn = n
for j in range(target+1):
  moji.append(divn%26)

  divn = int(divn/26)
  if divn < 1:
    break
count = 0
for o in moji:
  if count == 0:
    before = o
    count += 1
    continue
  if (before == 0):
    moji[count] -= 1
  before = moji[count]
  count += 1
moji.reverse()
text = ""
for m in moji:
  text += chenge_moji(m)

print(text)

Submission status: Wrong Answer

Solution code:

def main():
  n = int(input())

  mod = 26

  n2 = n
  i = 0
  while n > 0:
    i += 1
    n2 = n
    n -= mod
    if n <= 0:
      break

    mod *= 26

  n = n2 - 1
  arr = []
  if n == 1:
    arr.append(1)
  else:
    while n > 1:
      a = n % 26
      arr.append(a)
      n -= a
      n //= 26


  arr.extend([0 for _ in range(i - len(arr))])
  arr.reverse()


  ref = ("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("".join([ref[a] for a in arr]))


main()

Submission status: Wrong Answer

Solution code:
N = int(input())
alph = [chr(i) for i in range(97,97+26)]
if N <= 26:
    print(alph[N-1])
    exit()

tmp = []
if N%26 == 0:
    while N > 26:
        tmp.append(0)
        N //= 26
else:
    while N > 26:
        tmp.append(N % 26)
        N //= 26
    tmp.append(N)

tmp.reverse()
ans = []

for i in range(len(tmp)):
    ans += alph[tmp[i]-1]
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np
import string as str

N = int(input())
s = 26 ** np.arange(1, 12)
# print(s)
low_letters = str.ascii_lowercase
name = ''
for i in range(len(s)-1):
    if N > s[i+1]:
        N = N - s[i]
while N != 0:
    b = N % 26
    if b == 0:
        name = name + low_letters[25]
    else:
        name = name + low_letters[b-1]
    N = N // 26
    if N == 1:
        break
print(name[::-1])

Submission status: Wrong Answer

Solution code:
from collections import deque
alphabets = '*abcdefghijklmnopqrstuvwxyz'
n = int(input())

q = deque()
while n > 26:
    q.appendleft(alphabets[n % 26])
    n //= 26

q.appendleft(alphabets[n % 26])

print("".join(q))