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())

su=[26**i for i in range(1,20)]
from itertools import accumulate
wa = list(accumulate(su)) 
import bisect
c = 0
n = n-1
if n>26:
    c=bisect.bisect_left(wa, n)
    n=n-wa[c-1]
m = n
k=26
bi=[]
for i in range(c+1):
    
      bi.append(n % k)
      n = (n-n%k)//k
print(bi)
al=[chr(ord('a') + i) for i in range(26)]

li = [al[i] for i in bi]
li.reverse()
if m in su:
  li.append('a')

mojiretu = ''.join(li)

print(mojiretu)

Submission status: Wrong Answer

Solution code:
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)

n=int(input())
print(num2alpha(n))

Submission status: Wrong Answer

Solution code:
N= int(input())
mylist =[]
while N >26:
    b = N%26
    mylist.append(b)
    N = N//26
if N ==26:
    mylist.append(0)
else:
    mylist.append(N)

num = ["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"]
ans = []
for i in reversed(mylist):
    ans.append(num[i])
ans
print(''.join(ans))

Submission status: Wrong Answer

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

from pprint import pprint
from collections import deque, defaultdict
from bisect import bisect_left
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.buffer.readline
INF = float('inf')


N = int(input())

exp_26 = [26 ** i for i in range(1, 12)]
# print(exp_26)
int_list = [26]
for i in range(10):
    n = int_list[i] + exp_26[i+1]
    int_list.append(n)
# print(int_list)

str_list = [chr(ord('a') + i) for i in range(26)]
q, r = divmod(N, 26)
# print(f'q = {q}, r = {r}')

num_str = bisect_left(int_list, N) + 1
# print(f'num_str = {num_str}')

if num_str == 1:
    res = str_list[r-1]
else:
    res = ''
    q %= 26
    for i in range(num_str-1):
        res += str_list[q-1]
    res += str_list[r-1]
print(res)

Submission status: Wrong Answer

Solution code:
moji = [chr(i) for i in range(97, 97+26)]
n = int(input())
keta=0
for i in range(15):
    if n < 26**i:
        keta =i
        #print("keta=",keta)
        break
n_tmp = n
ans_li = ''
for i in range(keta):
    #print("ok")
    moji_num = n_tmp//(26**((keta-1-i)))
    #print("moji_mun",moji_num)
    ans_li += moji[moji_num-1]
    #print(moji[moji_num-1])
    n_tmp = n_tmp%(26**((keta-i)-1))
print(ans_li)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
def num2alpha(N):
  if (N-1)<=26:
    return chr(64+N-1)
  elif (N-1)%26==0:
    return num2alpha((N-1)//26-1)+chr(90)
  else:
    return num2alpha((N-1)//26)+chr(64+(N-1)%26)
  
num2alpha(N-1)

Submission status: Wrong Answer

Solution code:
N =int(input())
num2alpha = lambda c: chr(c+64)
a=[]
while int(N/26) >> 0:
    if (N%26) == 0:
        a.append("z")
    else :
        print("")
        a.append(num2alpha(int(N%26)).lower())
    N=int(N/26)
a.reverse()
print(''.join(a))

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)

Submission status: Wrong Answer

Solution code:
n = int(input())

l = []

for _ in range(15):
  if n <= 26:
    l.append(n)
    break
  l.append(n%26)
  n -= n%26
  n = int(n/26)
  

l = list(reversed(l))

ans = []
for i in l:
  if i == 0:
    ans.append('z')
  else:
    ans.append(chr(i+96))
  
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
N_ORG = int(input()) 
N = N_ORG
ret = list()
l = 'aabcdefghijklmnopqrstuvwxyz'
L = [26]
num = 26
i = 2
while True:
    if num > N:
        break
    num = L[-1] + 26 ** i
    L.append(num)
    i += 1

while N > 0:
    ret.append(N % 26)
    N //= 26


ans = ''
i = 0
while True:
    if L[i] >= N_ORG:
        break
    i += 1
for j in range(i + 1):
    ans = l[ret[j]-1] + ans

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = N
num = 0
ar = []
mod = s
while (s > 26):
    q, mod = divmod(s, 26)
    if mod == 0:
        mod = 26
        s = q - 1
    else:
        s = q
    ar.append(mod)
    num += 1
if mod == 0:
    mod = 26
ar.append(mod)
ar.reverse()
for i in ar:
    print(chr(i+96), end='')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input()) 
S = ''
K = (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10)

for outer  in range(10):
    K -= 26**(10 - outer)
    print(K)
    if N > K:
        
        for iter in range(27):
            if N <= K + (iter) * 26**(10 - outer -1 ):
                S += chr(97+iter - 1)
                N -= (iter) * 26**(10 - outer - 1)
                break


# if N > (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9):
#     for iter in range(25):
#         if N < (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8) +iter * 26**9:
#             S += chr(97+iter)
#             N -= iter * 26**9
#             break



print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())
keta = 1
while (N-1)//26**keta >= 1:
    keta += 1
for i in range(1, keta):
    N -= 26**i
alph = 'abcdefghijklmnopqrstuvwxyz'
ans = []
ans.append(alph[(N%26)-1])
for i in range(1, keta):
    num = (N-1)//(26**i)
    if num ==0:
        ans.append("a")
    else:
        ans.append(alph[(num%26)])
ans.reverse()
print("".join(ans))

Submission status: Wrong Answer

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

if n==702:
  print("zz")
elif n<703:
  while True:
    if n>26:
      ans=ans+cal(int(n/26))
    else:
      ans=ans+cal(n%26)
      break
    if int(n/26)>26:
      n=int(n/26)
    else:
      n=n%26
  
  
  print(ans)

else:
  while True:
    if n>26:
      ans=ans+cal(int(n%26))
    else:
      ans=ans+cal(n%26)
      break
    if int(n/26)>26:
      n=int(n/26)
    else:
      n=n%26
  
  
  print(ans[::-1])

Submission status: Wrong Answer

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
t6s = [26**i for i in range(12)]
ketas = [26**i for i in range(12)]
for i in range(11):
    ketas[i+1] = ketas[i] + ketas[i+1]

# keta = bisect_left(ketas, N)
# resi = N%ketas[keta-1]

# print(t6s)
# print(ketas)
moji = 'abcdefghijklmnopqrstuvwxyz'

res = ''
while 0<N:
    br = bisect_right(t6s, N)
    shou = N//t6s[br-1]
    resi = N%t6s[br-1]
    # print(' br', br)
    if shou==1 and N>=ketas[br-1] :
        res += 'a'
    elif shou==1 and N<ketas[br-1]:
        res += 'z'
    else:
        res += moji[shou-1]

    N = resi

print(res)

Submission status: Wrong Answer

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

'''

'''

from string import ascii_lowercase as al
from math import log, floor, ceil

def decimal_to_26base(n):
    exp = floor(log(n, 26))
    nums = []
    while n > 0:
        v = int(floor(n / 26**exp))
        n -= v * 26**exp
        nums.append(int(v))
        exp -= 1
    return nums


def product(lst):
    res = 1
    for v in lst:
        res *= v
    return res


def build_string(nums):
    return "".join(al[i-1] for i in nums)

"""
def solve(n):
    
    upper limit:
    26^k +
    

    length = 0
    i = 1
    cur = 0
    while n > cur:
        cur += 26**i
        length += 1
        i += 1

    sum_before = sum(26**i for i in range(1, length)) if length > 1 else 0
    #print(sum_before)
    n -= sum_before
    print(n)
    nums = [26] * length

    if product(nums) == n:
        return build_string(nums)

    for i in range(length):

        if product(nums) == n:
            return build_string(nums)

        while nums[i] > 1:
            nums[i] -= 1
            p = product(nums)

            if p == n:
                break
            elif p > n:
                continue
            else:
                # p < n
                nums[i] += 1
                break
    
    print(product(nums) == n)
    print(nums)
    print("didnt make it")
    return build_string(nums)
"""

def solve(n):
    nums = decimal_to_26base(n)
    return build_string(nums)


        


n = int(input())
print(solve(n))

Submission status: Wrong Answer

Solution code:
N = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'

if N <= 26:
    print(alphabet[N-1])
    exit()

ans = []
rem = N

while N > 26:
    rem = N % 26
    if rem == 0:
        N = N // 26 - 1
    else:
        N = N // 26
    ans.append(alphabet[rem-1])
    # print(N, rem)

ans.append(alphabet[rem-1])

ans.reverse()
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

m=[]
m= base(N, 26)
m=m[::-1]

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']
for i in range(len(m)):
  m[i]=alphabet[m[i]-1]

for i in range(1,len(m)):
  m[0] +=m[i]


print(m[0])

Submission status: Wrong Answer

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
 
def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

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

    ans = base_cvt(n, 26)
    ans = ans.replace('11110', 'zzzz')
    ans = ans.replace('1110', 'zzz')
    ans = ans.replace('110', 'zz')
    ans = ans.replace('10', 'z')
    ans2 = ans.translate(str.maketrans({'1':'a', '2':'b', '3':'c', '4':'d', '5':'e', '6':'f', '7':'g', '8':'h', '9':'i', 'a':'j', 'b':'k', 'c':'l', 'd':'m', 'e':'n', 'f':'o', 'g':'p', 'h':'q', 'i':'r', 'j':'s', 'k':'t', 'l':'u', 'm':'v', 'n':'w', 'o':'x', 'p':'y'}))
    
    return ans2


print(solve())

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = []
while N > 0:
    val = N
    cnt = 0
    while val > 26:
        val = val // 26
        cnt += 1
    X = N // (26 ** cnt)
    N -= X * (26 ** cnt)
    if cnt == 1 and N == 0:
        ans.append(chr(X+96-1))
        ans.append(chr(26+96))
        break
    elif cnt == 1 and N > 0:
        ans.append(chr(X+96))
        ans.append(chr(N+96))
        break
    else:
        ans.append(chr(X+96))
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
#if 1<= N <= 1000000000000001:
s = list('abcdefghijklmnopqrstuvwxyz')
u = ""
for i in range(12,0,-1):
    K = N // (26 ** i)
    N = N % (26 ** i)
    if K >0:
        u += s[(K - 1)]          
u += s[(N - 1)]
print(u)

Submission status: Wrong Answer

Solution code:
n=int(input())

a='abcdefghijklmnopqrstuvwxyz'
ans=''

x=0
while True:
    if (26**(x+1)-26)/25>=n:
        break
    x+=1
beam=x

for i in range(beam):
    x=n%26
    if x==0:
        if n%26**2==26:
            x=26
    n=(n-x)//26
    ans+=a[x-1]
print(ans[::-1])

Submission status: Wrong Answer

Solution code:
n = int(input())

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


while(n > 1):
    am = n%26
    
    n = n//26
    
    re.append(al[am])
    
re.reverse()

for i in re:
    print(i,end="")

Submission status: Wrong Answer

Solution code:
N = int(input())
q = N // 26
mod = N % 26
A = []
B = []
def num2alpha(c):
    if(c>0):
        return chr(c+96)
    else:
        return 'z'
if(mod == 0):
    while(True):
        B.append('z')
        if (q == 1):
            break
        q = (q - 1)/ 26
else:
    while(True):
        A.append(mod)
        if(q<27):
            if(q != 0):
                A.append(q)
            break
        mod = q % 26
        q = q // 26
    A.reverse()
    for x in A:
        B.append(num2alpha(x))
B="".join(B)
print(B)

Submission status: Wrong Answer

Solution code:
n = int(input()) - 1

num = 1
while 26**num < n:
    n -= 26**num
    num += 1

r = []
while 25 < n:
    r.append(n % 26)
    n //= 26

r.append(n)

if len(r) < num:
    for i in range(num - len(r)):
        r.append(0)

for i in r[::-1]:
    print(chr(97+i), end='')

Submission status: Wrong Answer

Solution code:
from math import log
N = int(input())

base = 96
roop = 0
tmp = 1
while 1:
    roop += 1
    if 26**roop + tmp > N:
        break
    tmp += 26**roop
ans = ['']*roop
tmp = N

for i in range(roop):
    if tmp%26 == 0:
        rem = tmp % 26
        ans[i] = chr(base+rem+26)
        tmp *= 26
    else:
        rem = tmp % 26
        ans[i] = chr(base+rem)
    tmp //= 26
ans.reverse()
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=''
while n>0:
    x=n%26
    print(n)
    print(chr(x+96))
    if x!=0:
        ans+=chr(x+96)
    else:
        ans+='z'
        n-=1
    n=n//26
print(ans[::-1])

Submission status: Wrong Answer

Solution code:
n = int(input())

n -= 1

cnt = 1
num = 26
name = ''
anum = 97

while n >= num:
    name += chr(n%26+anum)
    n = int(n/26)

name += chr(n%26+anum-1)

name = name[::-1]

print(name)

Submission status: Wrong Answer

Solution code:
N = int(input())

num = 0
pow = 1
old_pow = 0
count = 1
for i in range(1, 12):
    old_pow = num
    pow *= 26
    num += pow
    if N <= num:
        break
    count += 1
N -= (old_pow + 1)
syou = 0
amari = 0
flag = True
amalist = []
if N <= 26:
    amalist.append(N)
    flag = False
while flag:
    syou, amari = divmod(N, 26)
    amalist.append(amari)
    N = syou
    if N <= 26:
        amalist.append(N)
        break
if len(amalist) < count:
    for i in range(count - len(amalist)):
        amalist.append(0)
amalist.reverse()
for i in range(len(amalist)):
    if amalist[i] == 26:
        amalist[i] = 'z'
    else:
        amalist[i] = chr(amalist[i]+97)
text = ''
for c in amalist:
    text += str(c)
print(text)

Submission status: Wrong Answer

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
 
def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

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

    ans = base_cvt(n, 26)
    print(ans)
    ans = ans.replace('11110', 'zzzz')
    ans = ans.replace('1110', 'zzz')
    ans = ans.replace('110', 'zz')
    ans = ans.replace('10', 'z')
    ans2 = ans.translate(str.maketrans({'1':'a', '2':'b', '3':'c', '4':'d', '5':'e', '6':'f', '7':'g', '8':'h', '9':'i', 'a':'j', 'b':'k', 'c':'l', 'd':'m', 'e':'n', 'f':'o', 'g':'p', 'h':'q', 'i':'r', 'j':'s', 'k':'t', 'l':'u', 'm':'v', 'n':'w', 'o':'x', 'p':'y'}))
    
    return ans2


print(solve())

Submission status: Wrong Answer

Solution code:
x = int(input())

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy > 0:
      if X_dumy % n == 0:
        out.append( 26 )
        X_dumy = 0
      else:
        out.append( X_dumy % n )
        X_dumy = int(X_dumy / n)
    return out
if 1 <= x <= 1000000000000001:
    out = Base_10_to_n(x, 26)[::-1]
    print( "".join(alphbet(i) for i in out).lower())

Submission status: Wrong Answer

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
t6s = [26**i for i in range(12)]
ketas = [26**i for i in range(12)]
for i in range(11):
    ketas[i+1] = ketas[i] + ketas[i+1]

# keta = bisect_left(ketas, N)
# resi = N%ketas[keta-1]

# print(t6s)
# print(ketas)
moji = 'abcdefghijklmnopqrstuvwxyz'

res = ''
while 0<N:
    br = bisect_right(t6s, N)
    shou = N//t6s[br-1]
    resi = N%t6s[br-1]
    print(' br', br)
    if shou==1 and N>=ketas[br-1] :
        res += 'a'
    elif shou==1 and N<ketas[br-1]:
        res += 'z'
    else:
        res += moji[shou-1]

    N = resi

print(res)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[chr(i) for i in range(97, 97+26)]
l=1
num=26

while N>num:
    l+=1
    N-=num
    num*=26
ans=[]
for i in range(l):
    ans.append(N%26)
    N//=26
if sum(ans)==0:
    print("z"*l)
else:
    ans[0]-=1
    an=""
    for j in ans[::-1]:
        an+=a[j]
    print(an)

Submission status: Wrong Answer

Solution code:
n = int(input())

    
string = []
count = 1
info = []
tem = 0
while n > tem:
    tem += 26**count
    if n > tem:
        count += 1
count -= 1

while count >= 0:
    tem = n // 26**count
    info.append(tem)
    n -= 26**count * tem
    count -= 1
    
for i in info:
    if i == 1:
        string.append("a")
    elif i == 2:
        string.append("b")
    elif i == 3:
        string.append("c")
    elif i == 4:
        string.append("d")
    elif i == 5:
        string.append("e")
    elif i == 6:
        string.append("f")
    elif i == 7:
        string.append("g")
    elif i == 8:
        string.append("h")
    elif i == 9:
        string.append("i")
    elif i == 10:
        string.append("j")
    elif i == 11:
        string.append("k")
    elif i == 12:
        string.append("l")
    elif i == 13:
        string.append("m")
    elif i == 14:
        string.append("n")
    elif i == 15:
        string.append("o")
    elif i == 16:
        string.append("p")
    elif i == 17:
        string.append("q")
    elif i == 18:
        string.append("r")
    elif i == 19:
        string.append("s")
    elif i == 20:
        string.append("t")
    elif i == 21:
        string.append("u")
    elif i == 22:
        string.append("v")
    elif i == 23:
        string.append("w")
    elif i == 24:
        string.append("x")
    elif i == 25:
        string.append("y")
    elif i == 26:
        string.append("z")

print("".join(string))

Submission status: Wrong Answer

Solution code:
N=int(input())
lists = 'abcdefghijklmnopqrstuvwxyz'
stack=0
_ans=[]
for n in range(1,100000):
    pre_stack=stack
    stack+=26**n 
    if stack >= N:
        diff=N-pre_stack
        ans=['a']*n
        _stack=0
        next_n=N
        for u in range(n,0,-1):
            re=n-u
            temp1=next_n//26**(u-1)
            if temp1 == 0:
                temp1=26
            if temp1 ==27:
                temp1=26
            _ans.insert(0,temp1)
            ans[re]=temp1
            temp2=next_n%26**(u-1)
            ans[re]=temp2
            next_n=next_n%26**(u-1)
        break 

ans=[]
for x in _ans:
    ans.insert(0,lists[x-1])
res=''.join(ans)
print(res)

Submission status: Wrong Answer

Solution code:
n = list(input())
for i in range(len(n)):
    n[i] = int(n[i])

def base_convert(nl, ibase, obase):
    o = []
    while any(nl):
        c = 0
        for i in range(len(nl)):
            c = c * ibase + nl[i]
            nl[i],c = divmod(c,obase)
        o.append(c)
    o.reverse()
    return o

x = base_convert(n, 10, 26)

ans = ""

if x[-1] == 0 and x[:-1].count(1) == len(x[:-1]):
    ans = "z"*len(x[:-1])

else:
    for i in range(len(x)):
        if x[i] == 0:
            x[i-1] -= 1
            x[i] = 26
    if 0 in x:
        x.remove(0)

    for i in x:
        ans += chr(ord('a') + i-1)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
ans=[]
alph=["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"]   
while N>26:
    amari=(N%26)
    N=N//26
    A.append(amari)
if N<=26:
    A.append(N%26)
for v in reversed(A):
    ans.append(alph[v-1])
newans="".join(ans)
print(newans)

Submission status: Wrong Answer

Solution code:
list = [0,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
num_list =[0]
for i in range(1,15):
    num_list.append(26**i+num_list[i-1])

n = int(input())
i = 0
while True:
    if num_list[i] >= n:
        break
    else:
        i +=1


word = []
for j in range(i,0,-1):
    x = n//26**(j-1)
    if x==27:
        word.append(26)
        n = n -26**(j-1)*(n//26**(j-1))+26**(j-1)
    else:
        word.append(x)
        n = n -26**(j-1)*(n//26**(j-1))

h =''
for k in range(len(word)):
    h+=str(list[word[k]])
print(h)

Submission status: Wrong Answer

Solution code:
number = int(input())
Toname = []
name = []
for i in range(10,0,-1):
    waru = 26 ** i
    if number >= waru:
        Toname.append(number // waru)
        number = number % waru
leng = len(Toname)
for j in range(leng):
    Toname[j] += 96
    name.append(chr(Toname[j]))
print(''.join(name))

Submission status: Wrong Answer

Solution code:
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"]
# 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
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,

N = int(input())
result = ""

a = N
while True:
    quotient = a // 26  # quotioent: 商
    mod = a % 26
    # print("q " + str(quotient) + " mod " + str(mod))
    if mod > 0:
        
        result = alphabets[mod - 1] + result
        a = quotient
    else:
        if quotient == 0:
            break
        else:
            a = quotient
            result = "z" + result
            if a // 26 == 0:
                break
            else:
                continue
        # result = alphabets[quotient] + result
print(result)

Submission status: Wrong Answer

Solution code:
from collections import deque
n=int(input())

b=26
count = 0
while True:
    count +=1
    if b > n:
        break
    else:
        n -= b
        b*=26

b/=26

if n == 0:
    for i in range(count-1):
        print('z',end='')
    print()
else:

    while True:
        t = int(n/b)
        if n < b:
            print('a',end='')
        elif t == 0:
            print('z',end='')
        else:
            if n <= 26:
                print(chr(96+t),end='')
            else:
                print(chr(97+t),end='')
        n%=b
        b/=26
        if b < 1:
            print()
            break

Submission status: Wrong Answer

Solution code:
i = int(input())
nexti = 0
nextii = 0
ans = str()
nextans = str()


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

else:
  print(ans)

Submission status: Wrong Answer

Solution code:
n = 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)
x = num2alpha(n)
print(x.upper())

Submission status: Wrong Answer

Solution code:
def  countSetBits(n): 
    count = 0
    while (n): 
        count += n & 1
        n >>= 1
    return count 
import math
def bubble_sort(c):
    n = len(c)
    for i in range(n):
        already_sorted = True
        for j in range(n - i - 1):
            if c[j][0] < c[j+1][0]:#it is according to the no of zeros
                c[j][0], c[j+1][0] = c[j+1][0], c[j][0]
                already_sorted = False
            if(c[j][0]==c[j+1][0]):
            	if(c[j][1]>c[j+1][1]):#this is for frsts come find
            		c[j][1], c[j+1][1] = c[j+1][1], c[j][1]
        if already_sorted:
            break
    return c
#use ord() for ascii
# def fun(l,r):
# 	if(l>r):
# 		return 
# 	m=(l+r)//2
# 	c.append([l-r,m])
# 	# c[m]=(r-l,l)
# 	fun(l,m-1)
# 	fun(m+1,r)
# t=int(input())
t=1
while t:
	t-=1
	n=int(input())
	# n,m=(map(int,input().split()))
	# l=list(map(int,input().split()))

	# string =input()
	# m=len(string)+1
	# ans=0
	# while(n):
	# 	n-=1
	# 	ans=(26*(m))%(int(1e9+7))
	# 	m+=1
	# print(ans)

	s="abcdefghijklmnopqrstuvwxyz"
	m=""
	while n:		
		# print(r)
		if(n%26==0):
			m+='z'
		else:
			m+=s[(n%26)-1]
		n=(n//26)
	# reverse
	m=m[::-1]
	print(m)

	# N, S = map(int,input().split())
	# A = list(map(int,input().split()))
	# mod = 998244353
	# dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
	# dp[0][0] = 1
	# for i in range(N) : 
	#     for j in range(S + 1) : 
	#         dp[i + 1][j] += 2 * dp[i][j]
	#         dp[i + 1][j] %= mod 
	#         if j + A[i] <= S : 
	#             dp[i + 1][j + A[i]] += dp[i][j]
	#             dp[i + 1][j + A[i]] %= mod
	# print(dp[N][S])
# stdout.flush()
# https://codeforces.com/contest/1320/problem/A
# https://codeforces.com/contest/431/problem/B
# a_dictionary = {"a": 1, "b": 2, "c": 3}
# max_key = max(a_dictionary, key=a_dictionary.get)
# a_dictionary = {"a": 1, "b": 2, "c": 3}
# all_values = a_dictionary.values()
# max_value = max(all_values)
# ans1=sorted(d.items(), key=lambda x:x[1], reverse=True)[0][1]

Submission status: Wrong Answer

Solution code:
n=int(input())
m=n

l=[26**i for i in range(15)]

k=[sum(l[0:i+1]) for i in range(15)]

e=0
for i in range(15):
  if n<k[i]:
    e=e
  else:
    e=e+1
l=l[0:e]
l.reverse()
list=[]
for i in range(e):
  m=int(n//l[i])
  list.append(m)
  n=n-l[i]*m
list.reverse()
for i in range(e-1):
  if list[i]==0:
    list[i]=26
    list[i+1]-=1

s=''
for i in range(e):
    s=chr(ord('a')+list[i]-1)+s
print(s)