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:
import math
N = int(input())
if math.log(25*N+26, 26) == int(math.log(25*N+26, 26)):
    d = int(math.log(25*N+26, 26)) -1
else:
    d = int(math.log(25*N+26, 26))
pre = (pow(26,d)-26)//25
diff = N - pre
ans = [97 for _ in range(d)]
for i in range(d):
    # print(i, diff)
    if i == d-1:
        ans[i] += diff -1
        break
    x = diff // pow(26, d-1-i)
    if x >= 26:
        ans[i] += 25
        diff -= 25*pow(26, d-1-i)
    else:
        ans[i] += x
        diff = diff % pow(26, d-1-i)

    # if i == d-1:
    #     ans[i] += diff -1
    #     break
    # if diff % pow(26, d-1-i) == 0:
    #     x = 26 -1
    # else:
    #     x = diff // pow(26, d-1-i)
    # ans[i] += x
    # diff -= x*pow(26, d-1-i)
for a in ans:
    print(chr(a), end='')

Submission status: Wrong Answer

Solution code:
n = int(input())

num = 0
i = 0
while(True):
    i += 1
    num += 26 ** i
    if num<n:
        continue
    else:
        num -= 26 ** i
        ans = ["a"] * i
        for j in range(1, i+1):
            num += 26 ** j
            if num<n:
                num -= 26 ** j
                continue
            else:
                num -= 26 ** j
                diff = n - num - 1
                for k in range(j, 0, -1):
                    if diff < 26:
                        ans[-k] = chr(ord(ans[-k]) + diff)
                        break
                    q, mod = divmod(diff, 26**(k-1))
                    diff = mod
                    ans[-k] = chr(ord(ans[-k]) + q)
            break
        break
    break

for i in range(len(ans)):
    print(ans[i], end="", sep="")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

def main():
    n26 = ["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 = []
    
    n = int(input())
    n -= 1
    
    out = Base_10_to_n(n,26)
    #print(out)
    
    nn = ""
    for i in out:
        nn = n26[i] + nn
    print(nn.lower())
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

n = int(input())
t = 0
i = 1

if n <= 26:
    s = n
else:
    while True:
        if t+26**i > n:
            break
        t += 26**i
        i += 1

    s = n-t

res = []
ans = ''
i -= 1

if s == 0:
    s = 26**i
    ans = 'z'*i
else:
    while True:
        if i == 0:
            break
        res.append(s//(26**(i)))
        s = s%(26**(i))
        i -= 1

    if s == 0:
        idx = len(res)-1
        while idx > 0:
            if res[idx] >= 1:
                res[idx] -= 1
                break
            else:
                res[idx] = 25
                idx -= 1

        res.append(25)
    else:
        res.append(s-1)

    for i in range(len(res)):
        ans += chr(97+(res[i]))

print(ans)

Submission status: Wrong Answer

Solution code:
import math
 
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())
M = N
name = []
 
while True:
    a = M // 26
    b = M % 26
 
    if a > 25:
        name.append(b)
        M = a
    else:
        name.append(b)
        name.append(a)
        break
 
tempList = []
check = False
 
for element in name:
    if element == 0:
        tempList.insert(0, alphabet[-1])
    else:
        tempList.insert(0, alphabet[element - 1])

print("".join(tempList))

Submission status: Wrong Answer

Solution code:
import math
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])
if (x26 in '0,'):
  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:
from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
from math import sqrt, log, log2
from fractions import Fraction

# n, k = map(int, input().split())
# nums = list(map(int, stdin.readline().split()))
# nums.sort()
# print(sum(nums[:k]))
import string
digs = string.digits + string.ascii_letters
n = int(input())

import re
def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1

    x *= sign
    digits = []

    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)

    if sign < 0:
        digits.append('-')

    digits.reverse()

    return ''.join(digits)


d = {'a':9, 'b':'a', 'c':'b', 'd':'e'}

convert = int2base(n, 26)
if '0' in convert:
    convert = list(convert)
    while True:
        convert = ''.join(convert)
        zeroloc = convert.find('0')
        convert = list(convert)
        if zeroloc == -1:
            break
        convert[zeroloc] = 'z'
        if convert[zeroloc-1].isalpha():
            if convert[zeroloc-1] == 'a':
                convert[zeroloc-1] = '9'
            else:
                convert[zeroloc-1] = chr(ord(convert[zeroloc-1]) - 1)
        else:
            convert[zeroloc-1] = str(int(convert[zeroloc-1]) - 1)

    convert = ''.join(convert)

ans = ''
for i in convert:
    if i in '123456789':
        ans += chr(ord('a') + int(i) - 1)
    else:
        if i!='z':
            ans += chr(ord(i) + 9)
        else:
            ans += 'z'
print(ans)

Submission status: Wrong Answer

Solution code:
import decimal
N=decimal.Decimal(input())
alphabet=[chr(ord('a') + i) for i in range(26)]

N_dumy = N
out = ''
icount=0
while N_dumy>0:
    out = alphabet[ int((N_dumy%26)-1)]+out
    if( ((N_dumy%26)==0) and (N_dumy/decimal.Decimal(26.0)==1.0)):
        N_dumy=(N_dumy/decimal.Decimal(26.0))
        N_dumy = N_dumy.quantize(decimal.Decimal('0'),rounding=decimal.ROUND_FLOOR)
    N_dumy=(N_dumy/decimal.Decimal(26.0))
    N_dumy = N_dumy.quantize(decimal.Decimal('0'),rounding=decimal.ROUND_FLOOR)
    icount+=1
    
print(out)

Submission status: Wrong Answer

Solution code:

Num = int(input())
alphaList = list("abcdefghijklmnopqrstuvwxyz")
amaList = []

while(Num != 0):
    amaList.append(Num%2)
    Num = Num//26

resultList = []
for i in range(len(amaList)):
    resultList.append(alphaList[amaList[-i]-1])

print(''.join(resultList))

Submission status: Wrong Answer

Solution code:
N=int(input())
alpha=[chr(ord('a') + i) for i in range(26)]
S=""
i=0
M=N*1
while(M>=1):
  M=(M-1)//26
  i+=1
if(i>0):
  N-=26**(i-1)+1
#print(N)
while(N>=1):
  #print(12)
  S+=alpha[N%26]
  N=N//26
  #print(N)
print(S[::-1])

Submission status: Wrong Answer

Solution code:
A=list("abcdefjhijklmnopqrstuvwxyz")
N=int(input())
def trans(x,k):
    string=""
    while x!=0:
        u,v=divmod(x,k)
        string=str(A[v-1])+string
        x=u
    return string
print(trans(N,26))

Submission status: Wrong Answer

Solution code:
N = int(input())
alf = [chr(i) for i in range(97, 97+26)]
List = []
for i in range(100):
  if N > 26:
    a = N % 26
    N = int(N / 26)
    List.append(alf[a-1])
  else:
    List.append(alf[N-1])
    break
    

print("".join(List))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [0]
ans = []
a = 0
cur = 1
while a < 1000000000000001:
  a += 26**cur
  cur += 1
  l.append(a)
l = list(reversed(l))
for i in range(len(l)-1):
  if l[i] >= n:
    ans.append(0)
  else:
    div = min((n-l[i+1]-1)//(l[i]-l[i+1]),26)
    n = n-div*(l[i]-l[i+1])
    ans.append(div)
ans.append(n)
ans =list(map(lambda x:x+96, ans))
for i in range(len(ans)):
  if ans[i] > 96:
    ans2 = ans[i:]
    break
ans2 = "".join([chr(i) for i in ans2])
print(n)
print(ans)
print(ans2)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=''
alf='aabcdefghijklmnopqrstuvwxyz'

while 1:
  l = N%27
  N = N//27
  ans+=alf[l]
  if N==0:
    break
print(ans[::-1])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
from collections import deque 
from functools import reduce

n = int(input())
az = "zabcdefghijklmnopqrstuvwxy"
cnt = 12
ret = []
ama = n % 26
na = n
for i in range(12, 0, -1):
    if 26**(i-1) > n:
        continue
    sho = na // (26**i)
    if sho > 0:
        ret.append(az[sho])
    na -= sho * (26**i)
if ama > 0:
    ret.append(az[ama])
if (ret[0] == 'z'):
    del ret[0]
re = "".join(ret)
print(re)

Submission status: Wrong Answer

Solution code:
n = int(input())

name = []

def binary26(n):
    if n != 26:
        o = str(n % 26)
    else:
        o = "26"
        n = n - 1
    n = int(n / 26)

    name.append(o)

    if n == 0:
        return n
    binary26(n)
    
a = binary26(n)
name.reverse()
i = 0


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

b = ""

for j in name:
    b = b + j

print (b)

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 (n - 1) % 26 == 0:
            ans += "z" 
        else:
            ans += alphabet[a - 1]
        if n <= 26:
            ans += alphabet[n - 1]
            ans = ans[::-1]
            print(ans)
            break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


N = int(input())

"""
tmp = 0
for i in range(1,12):
  tmp += 26**i
  print("i =",i)
  print("tmp =",tmp)
  if ( tmp < N ):
    print("tmp < N")
  elif ( tmp == N ):
    print("tmp = N")
  else:
    print("tmp > N")
"""

tmp = 0
for i in range(1,13):
  
  tmp += 26**i
  if ( tmp >= N ):
    fct = i
    break


pre_N = N
ans_num = []

for i in range(fct):
  div = 26 ** ( fct - (i+1) )
  Q = pre_N // div
  R = pre_N %  div
  pre_N = R
  ans_num.append(Q)
  
  #print(i+1,Q,R)


#print(ans_num)
for i in range(fct):
  if ( ans_num[i]==27 ):
    ans_num[i] = 26
    ans_num[i+1] += 26
  if ( ans_num[i]==0 ):
    ans_num[i-1] += -1
    ans_num[i] = 26
#print(ans_num)

ans = []
for i in range(fct):
  chara = chr(ans_num[i]+96)
  ans.extend( chara )

print(''.join(ans))

Submission status: Wrong Answer

Solution code:
def solve() :
    n = int(input()) - 1
    d = []
    x = 1 

    if n < 26 :
        print(chr((n)+97))
        return None

    while n >= 26 :
        d.append(n % 26)
        n = n // 26

    print(chr((n)+96), end="")

    d.reverse()

    for i in d :
        if i == 0 :
            print(chr((i)+97), end="")
        else :
            print(chr((i)+96), end="")

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
n = int(input().strip())
dic = {
    0:  'z',
    1:  'a',
    2:  'b',
    3:  'c',
    4:  'd',
    5:  'e',
    6:  'f',
    7:  'g',
    8:  'h',
    9:  'i',
    10: 'j',
    11: 'k',
    12: 'l',
    13: 'm',
    14: 'n',
    15: 'o',
    16: 'p',
    17: 'q',
    18: 'r',
    19: 's',
    20: 't',
    21: 'u',
    22: 'v',
    23: 'w',
    24: 'x',
    25: 'y',
    26: 'z'
       }

ans = ''

keta = 15

while True:
    if (26 ** keta) <= n:
        break
    keta -= 1

for i in range(keta, -1, -1):
    sho = n // (26 ** i)
    amari = n % (26 ** i)
    if amari == 26:
        continue
    else:
        ans += dic[amari % 26]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
# print(N)

steps = 1
base = 26
number = [26]

while True:
  if N > base:
    steps += 1
    base += 26 ** steps
    number.append(base)
  else:
    base -= 26 ** steps
    # steps -= 1
    break

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 base == 0:
  x = N
else:
  x = N % base

# print(steps, x)
  
letters = ""
base_26 = []

for i in range(1, steps + 1):
  if N >= 26 ** (steps - i):
    m = N // 26 ** (steps - i)
    if m == 27:
      base_26.append(N // 26 ** (steps - i) - 1)
      N -= 26 ** (steps - i) * (N // 26 ** (steps - i) - 1)
    else:
      base_26.append(N // 26 ** (steps - i))
      N -= 26 ** (steps - i) * (N // 26 ** (steps - i))
  else:
    # print("!")
    base_26.append(0)
    # letters += "a"

for i in base_26:
  letters += alphabet[i- 1]

print(letters)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np
N = int(stdin.readline().rstrip())


data = []
for i in range(13):
  K = 12 - i
  #print(k)
  if N // 26 ** K >= 1:
    a = N // 26**K
    data.append(N // 26**K)
    N = N - (26 ** K)*a

alphabets = ['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']
answer = ""
for i in range(len(data)):
  data[i] = alphabets[data[i]-2]
  answer += data[i]
print(data)

Submission status: Wrong Answer

Solution code:
def Base_10_to(Xn, n):
    x = Xn
    li = []
    while x > 0:
            ans = x % n
            li.append(ans)
            x = int(x / n)
    li.reverse()
    return li

a = int(input())
cli = [chr(i) for i in range(97, 97+26)]
ili = []

ans = []
str = ''

ili = Base_10_to(a, 26)
if not 0 in ili:
    for i in range(len(ili)):
        str += cli[ili[i] - 1]
    print(str)
elif a / 26 < 10 and a % 26 == 0:
    a = int(a / 26)
    str = cli[a - 2] + 'z'
    print(str)
else:
    ili.pop(-1)
    for i in range(len(ili)):
        str += cli[ili[i] - 2]
    print(str)

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+25
                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())
cnt = 0
arr = []
ans = ""
moji = "zabcdefghijklmnopqrstuvwxy"
flg = False
if n % 26 == 0:
    flg = True

for i in range(1000000):
    arr.append(n % 26)
    n = n // 26
    if n == 0:
        cnt = i
        break

arr.reverse()

if flg:
    print("z" * cnt)
else:
    for i in arr:
        ans +=moji[i]
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

keta_now = 0
res_num = []

MAP = {
    1:"a",
    2:"b",
    3:"c",
    4:"d",
    5:"e",
    6:"f",
    7:"g",
    8:"h",
    9:"i",
    10:"j",
    11:"k",
    12:"l",
    13:"m",
    14:"n",
    15:"o",
    16:"p",
    17:"q",
    18:"r",
    19:"s",
    20:"t",
    21:"u",
    22:"v",
    23:"w",
    24:"x",
    25:"y",
    26:"z",
}

while True:
    keta_now += 1
    if n < sum([26**k for k in range(keta_now+1)]):
        for i in range(keta_now, 0, -1):
            for al in range(26, 0, -1):
                if i == 1:
                    res_num.append(n)
                    break
                if n > (26**(i-1) * al):
                    res_num.append(al)
                    n -= (26**(i-1) * al)
                    break
        break           
print("".join([MAP[n] for n in res_num]))

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'))
                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())
mod = 26
x = 1
l = list()
while True:
    if n <= mod:
        print(n)
        for i in range(x):
            l.append(n%26)
            n = n//26
        break
    else:
        n -= mod
        mod *= 26
        x += 1
l.reverse()

l2 = list()
print(l)
# if l.count(0) == x:
#     print("z"*x)
#     exit()
# for i in range(len(l)):
#     if l[i] == 0:
#         l[i-1] -= 1
#         l[i] = 26
if l.count(0) == x:
    print("z"*x)
    exit()
for i in range(x-1):
    l[i] += 1
for i in range(x-1,-1,-1):
    if l[i] == 0:
        l[i-1] -= 1
        l[i] = 26
print(l)
for i in range(len(l)):
    l2.append(chr(l[i]+96))
print("".join(l2))

Submission status: Wrong Answer

Solution code:
n = int(input())
st =[chr(ord("a") + i) for i in range(26)]
ans = []
if n <= 26:
    print(st[n-1])
else :
  while True :
     a = n%26
     n //= 26
     ans.append(a)
     if n <=25:
         ans.append(n)
         break
  ans.reverse()

  l =[]
  for i in ans:
    ls = st[i-1]
    l.append(ls)
  print("".join(l))

Submission status: Wrong Answer

Solution code:
num=int(input())


def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

ans=num2alpha(num)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
alpha=[chr(ord('a') + i) for i in range(26)]
S=""
i=0
M=N*1
while(M>=1):
  M=(M-1)//26
  i+=1
if(i>0):
  N-=26**(i-1)+1
print(N)
while(N>=1):
  #print(12)
  S+=alpha[N%26]
  N=N//26
  #print(N)
print(S[::-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
zflag = 1
azero = 0
while True:
    a = n % 26
    n = n//26
    ans = s[a-zflag] + ans
    if a == 0:
        zflag += 1
    if n == 0:
        break
ansl = len(ans)
if ans == "z"*ansl:
    ans = "z"*(ansl-1)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
str = ''
str_list = 'abcdefghijklmnopqrstuvwxyz'

def get_N(N):
  i = 1
  while True:
    if N > 26 ** i:
      N -= 26 ** i
      i += 1
    else:
      return N, i
    
N, num = get_N(N)

for i in reversed(range(num)):
  if N < (26**i) - 1:
    str += 'a'
  else:
    str += str_list[N // (26**i)-1]
    N -= 26**i * (N // (26**i))
    
print(str)

Submission status: Wrong Answer

Solution code:
import decimal
N=decimal.Decimal(input())
alphabet=[chr(ord('a') + i) for i in range(26)]

N_dumy = N
out = ''
icount=0
while N_dumy>0:
    out = alphabet[ int((N_dumy%26)-1)]+out
    print(int((N_dumy%26)), alphabet[ int((N_dumy%26)-1)],(N_dumy/decimal.Decimal(26.0)) )
    if( ((N_dumy%26)==0) and (N_dumy/decimal.Decimal(26.0)==1.0)):
        N_dumy=(N_dumy/decimal.Decimal(26.0))
        N_dumy = N_dumy.quantize(decimal.Decimal('0'),rounding=decimal.ROUND_FLOOR)
    N_dumy=(N_dumy/decimal.Decimal(26.0))
    N_dumy = N_dumy.quantize(decimal.Decimal('0'),rounding=decimal.ROUND_FLOOR)
    print(N_dumy)
    icount+=1
    
print(out)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = [chr(ord("a")+i) for i in range(26)]
num, i = 26, 1
while n - num > 0:
    i += 1
    num += pow(26, i)
ans = ""
while i > 0:
    tmp = 0
    for j in range(1, 27):
        if n - j*pow(26, i-1) < 0:
            break
        tmp = j
    ans += s[tmp- 1]
    n -= tmp*pow(26, i-1)
    i -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
import string

n = int(input())

alpha = list(string.ascii_lowercase)

result = ''

while 26 < n:
    digit = n % 26
    n = int(n // 26)
    result = alpha[digit-1] + result

result = alpha[n - 1] + result
print(result)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
check = "abcdefghijklmnopqrstuvwxyz"

if N <= 26:
  print(check[N-1])
  exit(0)
i = 1
keta = 26**i 
while keta < N:
  i += 1
  keta = 26**i +keta
if keta == N:
  print("z"*(i))
  exit(0)
if N%26**i ==0:
  print("y"+"z"*(i-1))
  exit(0)



ans = ""
for j in range(i):
  checker = math.floor(N / 26**(i - j-1 ))
  if checker > 26:
    checker = 26
  N = N - checker*(26**(i-j-1))
  if j >= 1 and "y" == ans[j-1]:
    s = check[checker]
    ans = ans + s
  else:
    s = check[checker-1]
    ans = ans + s
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import sys
l=list("abcdefghijklmnopqrstuvwxyz")
# print(l)
n=int(input())
p=1
while n>26**p:
    p+=1
if p==1:
    print(l[n-1])
    sys.exit()
m=n-26**(p-1)

s=list("a"*p)
w=[]
z=1

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)

y=Base_10_to_n(n,26)
Y=list(y)
s=""
for i in range(len(Y)):
    s+=l[int(Y[i])-1]
print(s)

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):
    if tmp%26 == 0:
        S.append(26)
    else:
        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:
import numpy as np

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

def main():
    n26 = ["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 = []
    
    n = int(input())
    n -= 1
    
    out = Base_10_to_n(n,26)
    #print(out)
    
    nn = ""
    for i in out:
        nn = n26[i] + nn
    print(nn.lower())
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if math.log(25*N+26, 26) == int(math.log(25*N+26, 26)):
    d = int(math.log(25*N+26, 26)) -1
else:
    d = int(math.log(25*N+26, 26))
pre = (pow(26,d)-26)//25
diff = N - pre
ans = [97 for _ in range(d)]
for i in range(d):
    # print(i, diff)
    if i == d-1:
        ans[i] += diff -1
        break
    x = diff // pow(26, d-1-i)
    if x >= 26:
        x -= 1
        ans[i] += x
        diff -= x*pow(26, d-1-i)
    else:
        ans[i] += x
        diff = diff % pow(26, d-1-i)

    # if i == d-1:
    #     ans[i] += diff -1
    #     break
    # if diff % pow(26, d-1-i) == 0:
    #     x = 26 -1
    # else:
    #     x = diff // pow(26, d-1-i)
    # ans[i] += x
    # diff -= x*pow(26, d-1-i)
for a in ans:
    print(chr(a), end='')

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 26
x = 1
l = list()
while True:
    if n <= mod:
        print(n)
        for i in range(x):
            l.append(n%26)
            n = n//26
        break
    else:
        n -= mod
        mod *= 26
        x += 1
l.reverse()

l2 = list()
print(l)
# if l.count(0) == x:
#     print("z"*x)
#     exit()
# for i in range(len(l)):
#     if l[i] == 0:
#         l[i-1] -= 1
#         l[i] = 26
if l.count(0) == x:
    print("z"*x)
    exit()
for i in range(x-1):
    l[i] += 1
for i in range(x-1,-1,-1):
    if l[i] == 0:
        l[i-1] -= 1
        l[i] = 25
print(l)
for i in range(len(l)):
    l2.append(chr(l[i]+96))
print("".join(l2))

Submission status: Wrong Answer

Solution code:
N = int(input())

keta = 0
max = 0
while True:
    keta += 1
    max += 26 ** keta
    if max >= N:
        break

# print(keta)

result = []
while keta >= 1:
    if N // 26 ** (keta-1) > 26:
        v = 26
    else:
        v = N // (26 ** (keta-1))

    N = N - (26 ** (keta-1)) * v
    # print(v, N)
    result.append(v)

    keta -= 1

# print(result)

a_z_list = [chr(ord('a') + i) for i in range(26)]
for v in result:
    print(a_z_list[v-1], end='')

# print('')

Submission status: Wrong Answer

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

n = int(input())
t = 0
i = 1

if n <= 26:
    s = n
else:
    while True:
        if t+26**i > n:
            break
        t += 26**i
        i += 1

    s = n-t

res = []
ans = ''
i -= 1

if s == 0:
    s = 26**i
    ans = 'z'*i
else:
    while True:
        if i == 0:
            break
        res.append(s//(26**(i)))
        s = s%(26**(i))
        i -= 1

    if s == 0:
        idx = len(res)-1
        while idx > 0:
            if res[idx] >= 1:
                res[idx] -= 1
                break
            else:
                idx -= 1

        res.append(25)
    else:
        res.append(s-1)

    for i in range(len(res)):
        ans += chr(97+(res[i]))

print(ans)

Submission status: Wrong Answer

Solution code:
def Base_10_to(Xn, n):
    x = Xn
    li = []
    while x > 0:
            ans = x % n
            li.append(ans)
            x = int(x / n)
    li.reverse()
    return li

a = int(input())
cli = [chr(i) for i in range(97, 97+26)]
ili = []

ans = []
str = ''

ili = Base_10_to(a, 26)
print(ili)
if not 0 in ili:
    for i in range(len(ili)):
        str += cli[ili[i] - 1]
    print(str)
elif a / 26 < 10 and a % 26 == 0:
    a = int(a / 26)
    print(a)
    str = cli[a - 2] + 'z'
    print(str)
else:
    ili.pop(-1)
    for i in range(len(ili)):
        str += cli[ili[i] - 2]
    print(str)

Submission status: Wrong Answer

Solution code:
n = int(input())
st =[chr(ord("a") + i) for i in range(26)]
ans = []
if n <= 26:
    print(st[n-1])
else :
  while True :
     a = n%26
     n //= 26
     ans.append(a)
     if n <=25:
         ans.append(n)
         break
  ans.reverse()
  print(ans)
  l =[]
  for i in ans:
    ls = st[i-1]
    l.append(ls)
  print("".join(l))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import string

n = int(input())

a_z = string.ascii_lowercase

num_list = []
i = 1

ans = ''

tmp = 0

while True:
  tmp += 26 ** i
  if n <= tmp:
    break
  else:
    i += 1

for j in range(i, 0, -1):
  if 1 <= n <= 26:
    num = n
    num_list.append(num)
  elif n <= (26 ** (j - 1)):
    num_list.append(1)

  else:
    num = n // (26 ** (j - 1))
    if num == 27:
      num = 26
    num_list.append(num)
    n -= (26 ** (j - 1)) * num

for num in num_list:
  ans += a_z[num - 1]

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
num2alpha = lambda c: chr(c+64)
def g(x):
    L = []
    while x > 0:
        if 1 <= x <= 26:
            L.append(x)
            break
        amari = x%26
        x = x//26
        if amari == 0:
            L.append(26)
        if amari > 0:
            L.append(amari)
    L.reverse()
    answer = ''
    for i in L:
        if 0 < i < 26:
            answer += num2alpha(i).lower()
        if i ==26:
            answer += 'z'
    return print(answer)
g(n)

Submission status: Wrong Answer

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

ans = ''

z_list = [0, 1]
count = 1
add = 1
while add <= N:
    add = add + 26**count
    count += 1
    z_list.append(add)

z_index = -1

count = -2
while N >= 1:
    index = N % 26
    N = N // 26
    if index == 1 and N == z_list[count]:
        index=0
    count-=1
#     if index == 1 and N in z_list:
#         index = 0
    ans = alpha[index] + ans
print(ans)