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())
a = 0
l = []

for i in range(1,12):
    a += 26**i
    l.append(a)

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

ans = []

while N != 0:
    x = N % 26
    N = N // 26
    ans.append(x)

ans.reverse()
ans_2 = []

for i in ans:
    ans_2.append(al[i-1])

print("".join(ans_2))

Submission status: Wrong Answer

Solution code:

N = int(input())

# for N in range(703,18278):
list_moji = []
n = int(N/26)
m = N%26
list_moji.append(m)
while n != 0:
    tmp = n
    n = int(tmp/26)
    m = tmp%26
    
    if n == 1:
        list_moji.append(0)
        for i in range(len(list_moji)):
            if list_moji[i] == 1:
                list_moji[i] = 0
        break
    else:
        list_moji.append(m)

string = ""
for i in reversed(list_moji):
    if i != 0:
        string += chr(96 + i)
    else:
        string += chr(96 + 26)
print(string)

Submission status: Wrong Answer

Solution code:
n = int(input())

A = []
N=0
N += n
keta = 0

H = []
h = []
for i in range(10):
    H.append(26**i)
#print(H)

while N//26 != 0:
    N //= 26
    keta += 1
#print(keta)


if n in H :
    for j in range(keta):
        h .append("z")
    print("".join(h))
else:
   
    cnt = 0
    for i in range(keta+1):
        moji = chr(ord("a")+n%26-1)
        n = int(n/26+0.5)
        A.append(moji)
#print(A)
    A.reverse()
    print("".join(A))

Submission status: Wrong Answer

Solution code:
import string

N = int(input())
al = string.ascii_lowercase

if (N >= 1 and N <= 26):
    print(al[N - 1])
    exit()
elif (N >= 27 and N <= 702):
    n = N // 26
    amari = N % 26
    if (amari == 0 and n != 27):
        print(al[n - 1] + al[25])
        exit()
    elif (amari == 0 and n == 27):
        print(al[25] + al[25])
        exit()
    else:
        print(al[n - 1] + al[amari - 1])
        exit()
elif (N >= 703):
    s = ''
    num = 26
    while N > 26:
        amari = N % num
        N //= 26
        if (amari == 0):
            N -= 1
        if (amari == 0):
            s += al[25]
        else:
            s += al[amari - 1]
if (N == 0):
    s += al[25]
else:
    s += al[N - 1]
print(s[::-1])

Submission status: Wrong Answer

Solution code:
N=int(input())
a1=['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']
a2=['','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']

name=[]

if N==702:
    print('zz')
    exit()
if N==18278:
    print('zzz')
    exit()
if N==475254:
    print('zzzz')
    exit()
if N==12345630:
    print('zzzzz')
    exit()
if N==321272406:
    print('zzzzzz')
    exit()
if N==8353082582:
    print('zzzzzz')
    exit()


for i in range (20):
    if N>26:
        _=N%26
        name.insert(0,a1[_])
        N=N//26
        if N==0:
            break
        else:
            pass
    elif 0<N<=26:
        _=N%26
        name.insert(0,a1[_])
        break
    else:
        break
print(name)

print(''.join(name))

Submission status: Wrong Answer

Solution code:
import sys
import os
import itertools
import numpy as np
from collections import deque

def main():
    if os.getenv("ENV")=='LOCAL':
        sys.stdin = open(os.path.dirname(__file__)+'/input.txt', 'r')

    N=int(input())
    alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

    name=[]

    while N >= 26:
        name.append(N%26)
        N=(N-N%26)//26
    name.append(N)

    # print(len(alphabet))
    # print(name)
    ans=""
    for i,n in enumerate(name):
        if i!=0 and name[i-1]==0:
            if not name[i]-1==0 or not len(name)==i+1:
                # print(i)
                if n-2<0:
                    name[i+1]-=1
                    ans+=alphabet[n+24]
                    name[i]=n+26
                else:
                    ans+=alphabet[n-2]
                    name[i]-=1
        elif n<0:
            name[i+1]-=1
            ans+=alphabet[n+25]
            name[i]=n+26
        else:
            ans+=alphabet[n-1]


    print(ans[::-1])

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

name = ''
while n >=1 and n <=1000000000000001:
  name += moji[(n%26)-1]
  n = n // 26


if ( n > 0 ):
  name += moji[(n%26)-1]


new_str = name[::-1]
print(new_str)

Submission status: Wrong Answer

Solution code:
N = int(input())

ansList = []

for i in range(12):
    ansList.append(N // 26 ** (11 - i))
    N = N % 26 ** (11 - i)

tmp = 0
for index, hoge in enumerate(ansList):
#    print(index, hoge)
    if(hoge != 0):
        tmp = index
        break

#print(tmp)
del(ansList[:tmp])
#print(ansList)


while True:
    for i in range(len(ansList)):
        if(ansList[i] == 0):
            ansList[i] = 26
            ansList[i-1] -= 1

    if(0 not in ansList[1:]):
        break


if(ansList[0] == 0):
    del ansList[0]

#print(ansList)

a_z_str = "abcdefghijklmnopqrstuvwxyz"
mojiList = []

for i in a_z_str:
    mojiList.append(i)

#print(mojiList)

kotaemaeList = []

for i in ansList:
    kotaemaeList.append(mojiList[i-1])

#print(kotaemaeList)

ans = ""
for i in kotaemaeList:
    ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
import string
import itertools

n = int(input())
i = 1
while True:
    if n < 26 ** i:
        break
    n -= 26 ** i
    i += 1

l = list(string.ascii_lowercase)
t = [l] * i
iter = list(itertools.product(*t))
print(''.join(iter[n-1]))

Submission status: Wrong Answer

Solution code:
X = int(input())


def Base_10_to_n(X):
    X_dumy = X-1
    out = []
    while X_dumy>25:
        out.append(int(X_dumy%26))
        X_dumy = int(X_dumy/26)
    out.append(X_dumy)
    return out

base26 = Base_10_to_n(X)
name = ''

if len(base26) > 1:
    for i in range(len(base26)-1):
        base26[i+1] -= 1

while len(base26) > 0:
    no = base26.pop(0)
    no = no + 97
    name = chr(no) + name

print(name)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


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



def solve(N: int):
    result = Base_10_to_n(N, 26)
    add=False
    answer = ''
    for r in result:
        if r == '0':
            add = True
        else:
            if add == False:
                answer += chr(int(r) + ord('a') - 1)
            elif r=='1':
                answer += 'z'
            else:
                answer += chr(int(r) + ord('a') - 1)
                add = False
    print(answer[::-1])



# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
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()
alph = [chr(i) for i in range(97,97+26)]
ans = []


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

Submission status: Wrong Answer

Solution code:
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

def solve(n):
	#n = readInt()
	i = 1
	maxk = 26
	while 1:
		if n<=maxk:
			ke = i
			break
		else:
			i+=1
			maxk =maxk + 26**i
	#print(ke)
	#ke 桁数
	tar = n
	l= []
	while 1:
		if tar<=26:
			l.append(tar)
			break
		else:
			t = tar%(26**(i-1))
			#t = tar//(26**(i-1))
			t = (tar-t)//(26**(i-1))
			t = min(t,26)
			l.append(t)
			tar = tar - t*(26**(i-1))
			i-=1

	print("".join([chr(96+i) for i in l]))

solve(924093)
#for i in range(1,1000000,26**2):
#	print(i)
#	solve(i)

Submission status: Wrong Answer

Solution code:
from collections import deque
from math import log
def main():
    n = int(input())
    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
    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:
N=int(input())
if N<=26:
  a=0
elif N<= 702:
  N -=26
  a=1
elif N<= 18278:
  N -=702
  a=2
elif N<= 475254:
  N-=18278
  a=3
elif N<= 12356630:
  N-=475254
  a=4
elif N<= 321272406:
  N-=12356630
  a=5
elif N <= 8353082582:
  N-= 321272406
  a=6
elif N<= 217180147158:
  N-=8353082582
  a=7
elif N <= 5646683826134:
  N-=21718014715
  a=8
elif N<= 146813779479510:
  N-=5646683826134
  a=9
elif N<= 3817158266467286:
  N-=146813779479510
  a=10
else:
  N-= 3817158266467286
  a=11
moji=["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 x in range(a+1):
  b=N%26
  print(moji[b-1],end="")
  N -= 26**(x+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
N = N
s = ["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 = ""
flag = False
for i in range(12):
  j = 11-i
  if N >26**j:
    flag = True
  if flag:
    aa = int(N/(26**j))
    ans+=s[aa-1]
    N = N%(26**j)
print(ans)

Submission status: Wrong Answer

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

N=int(input())
ban=N
ANS=[]
count=0
count1=26
count2=2
A=[chr(i) for i in range(97, 97+26)]
for i in range(2,1000000000000):
    count=26**i
    if count+count1==N:
        for j in range(count2):
            ANS.append(A[25])
            #print("1")
        ans="".join(ANS)
        print(ans)
        sys.exit()
    count1=count+count1
    if count1>1000000000000001:
        break
    count2+=1
#print(A[25])
if N<=26:
    print(A[N-1])
    sys.exit()
for i in range(N):
    ban=N//26
    amari=N%26
    if amari==0 and ban>26:
        ANS.append(A[amari-2])
    else:
        ANS.append(A[amari-1])
    
    if ban<=26:
        if amari==0:
            ANS.append(A[ban-2])
        else:
            ANS.append(A[ban-1])
        
        ANS.reverse()
        ans="".join(ANS)
        print(ans)
        sys.exit()
    N=ban
    
#print(A[25])

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]
                        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]
                        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]
                        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]
                        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]
                        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]
                        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]
                        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:
n = int(input())
a = ''

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = []
while 1:
    k = N // 26
    r = N - 26*k
    N = k
    ans.append(r)
    if k == 0:
        break


ans.reverse()

ret = []
if sum(ans[1:])==0:
    for a in ans:
        if a !=0:
            ret.append(chr(ord("a")+a-2))
        else:
            ret.append("z")
else:
    for a in ans:
        if a !=0:
            ret.append(chr(ord("a")+a-1))
        else:
            ret.append("z")
print("".join(ret))

Submission status: Wrong Answer

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

dog_num = int(input())

str1 = 26
str2 = 702
str3 = 18278
str4 = 475254
str5 = 12356630
str6 = 321272406
str7 = 8353082582
str8 = 217180147158
str9 = 5646683826134
str10 = 146813779479510
str_list = [str1,str2,str3,str4,str5,str6,str7,str8,str9,str10]

moji_len = 0
if (dog_num <= str1):
    moji_len = 1
elif (dog_num <= str2):
    moji_len = 2
elif (dog_num <= str3):
    moji_len = 3
elif (dog_num <= str4):
    moji_len = 4
elif (dog_num <= str5):
    moji_len = 5
elif (dog_num <= str6):
    moji_len = 6
elif (dog_num <= str7):
    moji_len = 7
elif (dog_num <= str8):
    moji_len = 8
elif (dog_num <= str9):
    moji_len = 9
elif (dog_num <= str10):
    moji_len = 10
else:
    moji_len = 11

key_num = dog_num
output = []

if dog_num <= 26:
    print(alpha[dog_num - 1])
else:
    for i in reversed(range(1,moji_len)):
        syou = key_num // (26 ** int(i))
        amari = key_num % (26 ** int(i))
        if (syou > 26):
            syou = syou - 1
            amari = amari + (26 ** int(i))
        key_num = amari
        output.append(alpha[syou - 1])
        if i == 1:
            output.append(alpha[amari - 1])

    result = ''.join(output)
    print(result)

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
# 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)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../input.txt')
# sys.stdin = f

def c(n):
    res = []
    while n>0:
        now = n%26
        res.append(chr(ord('a')+now-1))
        n = n//26
    if res[-1]=='z':
        for i in range(len(res)-1, -1, -1):
            res[i] = chr(ord(res[i]-1))
    return res[::-1]


def main():
    n = N()
    res = c(n)
    tag = False
    ret = ''

    for i in range(len(res)-1, -1, -1):
        if res[i]=='`':
            ret+='z'
            tag = True
            continue
        if tag:
            if res[i]=='a': ret+='z'
            else:
                ret+=chr(ord(res[i])-1)
            tag = False
        else:
            ret+=res[i]
    print(ret[::-1])

if __name__ == "__main__":
    # for i in range(1, 10000):
    #     # main(i)
    #     # print(i)
    #     pass
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 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']

ans = []
while n//26 > 0 :
  res = n % 26
  if res != 0:
    ans.append(A[res-1])
    n = n // 26
  elif res == 0:
    ans .append(A[25])
    n = n // 26 -1

if res != 0:
  ans.append(A[res-1])

print(*ans[::-1], sep='')

Submission status: Wrong Answer

Solution code:
N = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
output = ""
while N > 26:
    mod = N % 26
    N = N // 26
    output = alpha[mod-1] + output
output = alpha[N-1] + output
print(output)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

N=int(input())

keta = []
keta.append(0)

xxx = 0
for i in range(1,12):
    keta.append(26**i + xxx)
    xxx = keta[i]

alpha = "abcdefghijklmnopqrstuvwxyz"

for i in range(1,12):
    if keta[i-1] < N and N <= keta[i]:
        tmp2 = i

S=[]

tmp = N
for i in range(tmp2):
    S.append(tmp%26)
    tmp = tmp//26

S.reverse()
ans = ""
for i in range(len(S)):
    ans += alpha[int(S[i])-1]

print(ans)

Submission status: Wrong Answer

Solution code:
def sequence(i):
  return 26 * (pow(26, i) - 1) // 25

n = int(input())
group = 1
while(n > sequence(group)):
  group += 1
  
at = n - sequence(group - 1)

name = ''
alph = 'abcdefghijklmnopqrstuvwxyz'

for i in range(group):
    base = at // pow(26, group - 1 - i)
    name += alph[base-1]
    at -= base * pow(26, group - 1 - i)

print(name)

Submission status: Wrong Answer

Solution code:
N = int(input())


ans = []
for i in range(10, 0, -1):
    p, q = divmod(N, 26 ** i)

    if p != 0:
        ans.append(p)
    N = q


if p == 0:
    ans.append(p)
ans.append(q)

for _ in range(len(ans)):
    for i in range(len(ans)):
        if ans[i] == 0 and i != 0:
            ans[i - 1] -= 1
            ans[i] = 26

n_ans = []
for i in ans:
    if i == 0:
        continue
    else:
        n_ans.append(chr(ord("a") + i - 1))


print("".join(n_ans))