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 sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res

N=II()
crr=[chr(97 + i) for i in range(26)]

def calc(n, c):
    if c == 0: return ""
    if c == 26: n += 1
    # print(n, c)
    cnt = 0
    while n >= c+1:
        n -= c
        cnt += 1
    c //= 26
    if cnt > 0:
        return crr[cnt-1] + calc(n, c)
    else:
        return calc(n, c)

print(calc(N, 26**11))

Submission status: Wrong Answer

Solution code:
n = int(input())
n -= 1
l = []
flag = True
flag2 = False
if n == 0:
    flag2 = True
for i in range(13):
    if i > 0:
        n -= 1
    s = n // 26
    a = n % 26
    l.append(a)
    if s < 26:
        if s > 0:
            s -= 1
            flag = False
        l.append(s)
        break
    else:
        n = s
l.reverse()
for i in range(len(l)):
    if l[i] == 0:
        if flag:
            l[i] = ''
        else:
            l[i] = 'a'
    elif l[i] == 1:
        l[i] = 'b'
    elif l[i] == 2:
        l[i] = 'c'
    elif l[i] == 3:
        l[i] = 'd'
    elif l[i] == 4:
        l[i] = 'e'
    elif l[i] == 5:
        l[i] = 'f'
    elif l[i] == 6:
        l[i] = 'g'
    elif l[i] == 7:
        l[i] = 'h'
    elif l[i] == 8:
        l[i] = 'i'
    elif l[i] == 9:
        l[i] = 'j'
    elif l[i] == 10:
        l[i] = 'k'
    elif l[i] == 11:
        l[i] = 'l'
    elif l[i] == 12:
        l[i] = 'm'
    elif l[i] == 13:
        l[i] = 'n'
    elif l[i] == 14:
        l[i] = 'o'
    elif l[i] == 15:
        l[i] = 'p'
    elif l[i] == 16:
        l[i] = 'q'
    elif l[i] == 17:
        l[i] = 'r'
    elif l[i] == 18:
        l[i] = 's'
    elif l[i] == 19:
        l[i] = 't'
    elif l[i] == 20:
        l[i] = 'u'
    elif l[i] == 21:
        l[i] = 'v'
    elif l[i] == 22:
        l[i] = 'w'
    elif l[i] == 23:
        l[i] = 'x'
    elif l[i] == 24:
        l[i] = 'y'
    elif l[i] == 25:
        l[i] = 'z'
if flag2:
    l.append('a')
print(''.join(l))

Submission status: Wrong Answer

Solution code:
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num)
    if amari == 0:
        amari = 122
    else:    
        amari += 96
    N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if amari == 'z':
        N = int(N / num)
    if N == 0:
        break

for l in name:
    S = S + l
print(str(S))

Submission status: Wrong Answer

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

n = int(input())
num2alpha = lambda c: chr(c+96)

result_list = []
while n > 26:
    remainder = n % 26
    n = n // 26
    result_list.insert(0, remainder)
result_list.insert(0, n)
result = ""
for i in result_list:
    result += num2alpha(i)
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
#27進数
def function(X, n):
    c = 0
    for t in range(0,100):
        if X <= 26**t:
            c = t
            break
    b = 0
    for j in range(1, 27):
        if X <= 26**(c-1)*j:
            b = j
            break

    b2 = chr(ord('a') + b - 1)
    if X-26**c*b <= 0:
        return b2
    else:
        return b2 + function(X-26**c*b,n)

x2 = function(N, 26)
#x3 = list(map(int,x2.split()))
print(x2)

Submission status: Wrong Answer

Solution code:
n = int(input())

l = []

for _ in range(100):
  if n < 26:
    l.append(int(n))
    break
  l.append(int(n%26))
  n -= n%26
  n = 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 = int(input())

L =[]
while N > 1:
  amari = N % 26
  L.append(amari)
  N = N // 26

ans = ''
trans =['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(L)):
  ans += trans[L[i]-1]

rans = ''
for i in range(len(ans)-1,-1,-1):
  rans += ans[i]
  
print(rans)

Submission status: Wrong Answer

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    x = 0
    string = ""
    
    while(n > 0):
        x = n % 27
        string = chr(x+64) + string
        n //= 26
        if n < 26:
            break


    print(string)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

length = 1
num = 26
l = [0,26]

while True:
    if num > n:
        break
    length += 1
    num = 26 ** length + num
    l.append(num)

ans = []
for i in range(length)[::-1]:
    if n < l[i]:
        ans.append('a')
        continue
    num = n - l[i] - 1
    if num == -1:
        ans.append('z')
        continue
    tmp = 26 ** i
    #print(num, tmp, num // tmp)
    ans.append(chr(num // tmp + 97))
    n = n % tmp
    #print(num, num // tmp, n)

print(''.join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

F = False
n = 0
g1 = 0
g2 = 0
for i in range(1, 15):
    g1 += 26**i - 26**(i-1)
    g2 += 26**i
    if i > 1 and g1 < N <= g2:
        F = True
        n = i

ALPHABET = "abcdefghijklmnopqrstuvwxyz"
S = ""
X = ""
while N > 0:
    Q, M = divmod(N, 26)
    S = ALPHABET[M - 1] + S
    N = Q

if F:
    S = S.replace("a"*n, "z")

print(S)

Submission status: Wrong Answer

Solution code:
cache = {
    1: 1,
    2: 27,
}


def main():
    N = int(input())
    result = solve(N)
    print(result)


def to_char(number) -> str:
    if number == 0:
        return 'z'
    else:
        return chr(ord('a') + number - 1)


def solve(N) -> str:
    result = []
    base = 0
    keta = 0
    for keta in range(12, 0, -1):
        base = foo(keta)
        if N < base:
            continue
        break
    for i in range(keta, 0, -1):
        for j in range(0, 26):
            if base + j * diff(i) > N:
                j -= 1
                break
        base += j * diff(i)
        result.append(chr(ord('a') + j))
    return ''.join(result)


def diff(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    else:
        return foo(n) - foo(n - 1)



def foo(n):
    if n in cache:
        return cache[n]
    if n == 1:
        return 1
    elif n == 2:
        return 27
    else:
        result = (foo(n - 1) - foo(n - 2)) * 26
        cache[n] = result
        return result


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    num = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
    ans = []
    for i in reversed(mylist):
        ans.append(num[i])
    print(''.join(ans))

Submission status: Wrong Answer

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

# nは1~10^16+1
# n = 701
# n = 18277
# n = 29
# n = 54


# まずは桁数を確定させる
# 26**iで収まる数で確認可能
k = 0
for i in range(1, 12):
  k += 26**i
  if n <= k:
    break

# iで桁数がわかる
# print(i)
# print(k)

# １桁からi桁まで26で割っていき、文字に変換する
name = []
for j in range(1, i+1):
  t = 26**j
  name.append((n % t)//26**(j-1))
  if n // t < 26:
    break
  else:
    n -= t
# print(name)


# nameの数値を変換する
name_c = []
for c in name:
  name_c.append(string.ascii_lowercase[c])
# print(name_c)
print(name_c[::-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
li=["","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=[]
def hen(X,n):
    if (int(X/n)):
        return hen(int(X/n),n)+str(X%n)
    return str(X%n)
ans=hen(n,26)
for i in range(len(ans)):
    a.append(li[int(ans[i-1])])
print(''.join(a))

Submission status: Wrong Answer

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

for j in range(15):
  if ((26**(j+1)-1)//25) <= N < (26**(j+2)-1)//25:
    for i in range(j+1):
      if i != j+1:
        K=(((N-N%(26**i))%26**(i+1))//26**(i))
        if K==0:
          K=26
        ans.insert(0,alphabets[K-1])
      else:
        K=(((N-N%(26**i))%26**(i+1))//26**(i))
        if K==1:
          K=26
        ans.insert(0,alphabets[K-1])
        
ans="".join(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input().rstrip())

b = a
c = []
for i in range(30):
    c.append(int(b%26))
    b = b/26
c.reverse()

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

for j in range(len(c)):
    print(aa[c[j]],end ="")
print("")

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = []
alp = ['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 True:
    a,b = divmod(n,26)
    if a >= 26:
        ans.append(alp[b - 1])
        n = a
    else:
        ans.append(alp[b - 1])
        ans.append(alp[a - 1])
        break

ans = ans[::-1]
print("".join(ans))

Submission status: Wrong Answer

Solution code:
N=int(input())
alp='abcdefghijklmnopqrstuvwxyz'
if N<=26:
  print(alp[N-1])
  exit()
  
ma=26**2+26
K=2
while ma<N:
  K+=1
  ma+=26**K
  
ans=''
for i in range(K-1, -1, -1):
  tmp=N//(26**i)
  if tmp>26:
    ans+='z'
    N-=26*26**i
  else:
    ans+=alp[tmp-1]
    N-=tmp*26**i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

# a 97 z 122

def dfs(i,x):
    ans = ''
    count = 26**i
    for j in range(1,i):
        x -= (26**j)
    for j in range(i):
        if j == i-1:
            if x == 0:
                temp = 122
            else:
                temp = int(x + 96)
        else:
            if x == 0:
                temp = 122
            elif int(x//(count//26)) == 26:
                temp = 122
            else:
                temp = int((x // (count//26)) + 97)
        ans += chr(temp)
        x -= (count // 26)*(x // (count//26))
        count /= 26
    return ans

i = 0
val = n
while val > 0:
    i += 1
    val -= 26**i

if i == 1:
    print(chr(n+96))
else:
    ans = dfs(i, n)
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def toa(n):
    return chr((ord('a')+(n)))

temp = 1
digit = 1
while temp+26**digit <= n:
    temp+=26**digit
    digit+=1

ans = ''
for i in range(digit, 0, -1):
    for j in range(27):
        if 26**(i-1) < n:
            n-=26**(i-1)
        else:
            if i==1:
                ans+=toa(j)
            else:
                ans+=toa(j-1)
            break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
N -= 1
alphabets = []
for i in range(26):
    alphabets.append(chr(ord('a') + i))

idx = 1
while 26 ** idx <= N:
    idx += 1
ans = []
while idx > 1:
    ans.append(alphabets[N // (26 ** (idx - 1)) - 1])
    N %= 26 ** (idx - 1)
    idx -= 1
ans.append(alphabets[N])
print(*ans, sep='')

Submission status: Wrong Answer

Solution code:
i = int(input())
n = []
q = divmod(i, 26)
j = 0
n.append(q[1])
while (q[0] != 0):
  j += 1
  q = divmod(q[0], 26)
  n.append(q[1])
  

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

Submission status: Wrong Answer

Solution code:
n = 18278
alplis = ['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']
num = 0
p = alplis[n % 26]
s = 0
for i in range(10000):
    
    
    num += 26**i
    if num > n:
        if i != 0:
            for y in range(1,i):
                s += 26**y
            n = n-s
            for x in range(i-1):
                i -= 1
                p = alplis[n//(26**(i))] + p
                n = n%(26**(i))
        break
print(p)

Submission status: Wrong Answer

Solution code:
n = int(input())

tag = ['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']
cnt = []

for i in range(10):
    if n//(26**(10-i)) != 0:
        cnt.append(n//(26**(10-i)))
        n = int(n%26**(10-i))

cnt.append(n)

if len(cnt) != 1:
    for i in range(len(cnt)-1):
        cnt[i] = tag[cnt[i]-1]
    if cnt[-1] != 0:
        cnt[-1] = tag[cnt[-1]-1]
    else:
        cnt[-1] = 'z'
        cnt[0] = ''
else:
    cnt[0] = tag[cnt[0]-1]

cnt = ''.join(cnt)

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = list()
while n>0:
    x = n % 26
    if x == 0:
        x = 26
        n=n-1
    ans.append(x)
    n = int(n / 26)
str_ans = ""
for x in ans[::-1]:
    str_ans += chr(x+96)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
n -= 1
l = []
flag = True
flag2 = False
if n == 0:
    flag2 = True
for i in range(13):
    if i > 0:
        n -= 1
    s = n // 26
    a = n % 26
    l.append(a)
    if s < 26:
        if s > 0:
            s -= 1
            flag = False
        l.append(s)
        break
    else:
        n = s
l.reverse()
for i in range(len(l)):
    if l[i] == 0:
        if flag:
            l[i] = ''
        else:
            l[i] = 'a'
    elif l[i] == 1:
        l[i] = 'b'
    elif l[i] == 2:
        l[i] = 'c'
    elif l[i] == 3:
        l[i] = 'd'
    elif l[i] == 4:
        l[i] = 'e'
    elif l[i] == 5:
        l[i] = 'f'
    elif l[i] == 6:
        l[i] = 'g'
    elif l[i] == 7:
        l[i] = 'h'
    elif l[i] == 8:
        l[i] = 'i'
    elif l[i] == 9:
        l[i] = 'j'
    elif l[i] == 10:
        l[i] = 'k'
    elif l[i] == 11:
        l[i] = 'l'
    elif l[i] == 12:
        l[i] = 'm'
    elif l[i] == 13:
        l[i] = 'n'
    elif l[i] == 14:
        l[i] = 'o'
    elif l[i] == 15:
        l[i] = 'p'
    elif l[i] == 16:
        l[i] = 'q'
    elif l[i] == 17:
        l[i] = 'r'
    elif l[i] == 18:
        l[i] = 's'
    elif l[i] == 19:
        l[i] = 't'
    elif l[i] == 20:
        l[i] = 'u'
    elif l[i] == 21:
        l[i] = 'v'
    elif l[i] == 22:
        l[i] = 'w'
    elif l[i] == 23:
        l[i] = 'x'
    elif l[i] == 24:
        l[i] = 'y'
    elif l[i] == 25:
        l[i] = 'z'
if flag2:
    l.append('a')
print(''.join(l))

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 reversed(range(keta)):
    #print("ok")
    moji_num = n_tmp//(26**(i))
    #print("moji_mun",moji_num)
    ans_li += moji[moji_num-1]
    #print(moji[moji_num-1])
    n_tmp = n_tmp%(26**i)
print(ans_li)

Submission status: Wrong Answer

Solution code:
#コンテスト中の実装（WA確定コード）
N=int(input())
kari=26
kasu=0
i=1
while True:
    if N>kari:
        i+=1
        kari+=26**i
    else:
        break
hikihiki=kari-26**i
ans=[]
def saiki(A):
    if len(A)==i:
        B="".join(A)
        ans.append(B)
        return
    if len(ans)>=N-hikihiki:
        return
    for j in ("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.append(j)
        saiki(A)
        A.pop()
"""ikkaime=i//2
nikaime=i-ikkaime
i=ikkaime
saiki([])
kari=ans.copy()
i=nikaime
ans=[]
saiki([])
print(kari[])
print(ans[])"""
saiki([])
print(ans[N%26-1])

Submission status: Wrong Answer

Solution code:
N = int(input())

syo = N // 26
amari = N % 26
alphabet = [chr(ord('a') + i) for i in range(26)]
count = 0
for i in range(100000000000000):
  if N <= 26:
    break
  else:
    N = int((N // 26))
    count = count + 1
    
ans = ''
for i in range(count):
  if amari != 0 and syo != 0:
    ans = ans + alphabet[N - 1]
  elif amari == 0:
    ans = ans + alphabet[amari - 1]

ans = ans + alphabet[amari - 1]

print(ans)

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:
import math

import numpy

n = int(input())

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

s = list("abcdefghijklmnopqrstuvwxyz")

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

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

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ALPHA_ARRAY = [chr(i) for i in range(97, 97+26)]

ALPHABET = 26

count = 0

flg = True

while flg:
    count += 1
    if N <= ALPHABET ** count:
        flg = False\

if count == 1:
    tmp = N
else:
    tmp = N - ALPHABET ** (count - 1)

flg_2 = True
result_array = []
while flg_2:
    amari = math.floor(tmp % ALPHABET)
    syo = math.floor(tmp / ALPHABET)
    if amari == 0:
        result_array.append(ALPHABET)
    else:
        result_array.append(amari)
    if syo < ALPHABET:
        if len(result_array) != count:
            for _ in range(0, count - len(result_array)):
                result_array.append(amari)
        flg_2 = False
    tmp = syo

result = ''
result_array.reverse()
# print(result_array)
for index in result_array:
    result += ALPHA_ARRAY[index - 1]

print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

ans=0
x=0
while n>ans:
    x+=1 #文字数
    ans+=26**x

ANS=[0]*x
#print(ANS)
c=0
N=n
i=1
y=0
if n<=26:
    ANS[0]=alpha[n%26]
else:
    ANS[0]=alpha[n%26]
    y=n
    while y>=1 and i<=x-1:
        if y%26==0:
            y=y//26
            ANS[i]=alpha[0]
            i+=1
        elif y%26==0 and y/26<26:
            y=y/26
            ANS[i]=alpha[y]
            i+=1
        else:
            y=y//26
            c=y%26
            ANS[i]=alpha[c]
            i+=1
ANS.reverse()
AA=''.join(ANS)
print(AA)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N = int(input())
temp = N
ans= ""
t = 26
count = 1

while True:
  if(N<=t):
    break
  else:
    N -= t
    t=t*26
    count+=1

#N = temp

#for i in range(count):
  

for i in reversed(range(1,count)):
  if(N//(26**i)==26):
    ans += chr(96+26)
  else:
    ans += chr(96+N//(26**i)+1)
  #print(N,i,N//(26**i))
  N = N%(26**i)
  #print(i)

if(N==0):
  ans += chr(96+26)
else:
  ans += chr(96+N)

#ans += chr(96+N)
#ans += chr(96+temp%26)

print(ans)

Submission status: Wrong Answer

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

out = ''
tmp = n
r = 1
c = 0
count = 1
while True:
    r *= 26
    # c += r
    print(c)
    if tmp > c+r:
        c += r
        count += 1
    else:
        break

tmp = n - c - 1
print(tmp)
# out = s[tmp%27-1]
# tmp = int(tmp/27)
while tmp>0:
    out = s[tmp%26]+out
    tmp = int(tmp/26)
# out = s[tmp%26-1]+out
for _ in range(count-len(out)):
    out = 'a'+out

print(out)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
dp = ["0"]*12

def main(p):
  count = 0
  m = p
  while (m-1)//26 >= 1:
    m = m//26
    count += 1
  dp[(-1)*count-1] = chr(m + 96)
  p -= 26**count*m
  if count == 0:
    #print(dp)
    a = "".join(dp)
    print(a.replace("0",""))
    sys.exit()
  else:
    main(p)
main(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

print(text)

Submission status: Wrong Answer

Solution code:
# Template 1.0
import sys, re
from decimal import *
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor, trunc, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


n = INT()

pows = [0]*11
pows[0] = 26
for i in range(1, 11):
    pows[i] = pows[i-1] + (26**(i+1))
# print(pows)

digits = 1
lo = 1
up = 26

# print(pows)
temp = defaultdict(int)
for i, el in enumerate(pows):
    temp[el] = 'z'*(i+1)
for i in range(1, 12):
    temp[26**i] = 'y'*(i-1) + 'z'

ans = ''

if(n in temp):
    ans = temp[n][::-1]

else:

    while(n>0):
        if (n in temp):
            ans = ans[::-1] + temp[n]
            break

        rem = n%26
        n = n//26

        if(rem==0):
            ans+='z'
            n-=1
        else:
            ans+=chr(96 + rem)

        # print(rem, n)
print(ans[::-1])

Submission status: Wrong Answer

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

    
from sys import stdin

N = int(input())

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

x26 = Base_10_to_n(N, 26)

result = ""

for i  in range(0, len(x26)):
    a = int(x26[i])
    b = alphabets[a - 1]
    result += b
print(result)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

length = 1
num = 26
l = [0,26]

while True:
    if num >= n:
        break
    length += 1
    num = 26 ** length + num
    l.append(num)

ans = []
for i in range(length)[::-1]:
    if n < l[i]:
        ans.append('a')
        continue
    num = n - l[i] - 1
    if num == -1:
        ans.append('z')
        continue
    tmp = 26 ** i
    #print(num, tmp, num // tmp)
    ans.append(chr(num // tmp + 97))
    n = n % tmp
    #print(num, num // tmp, n)

print(''.join(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
rem = []
alph = 'abcdefghijklmnopqrstuvwxyz'

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

res = ''
for i in rem[::-1]:
  if i==0: i=26
  res += alph[i-1]

print(res)

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()
# 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
for i in range(len(l)):
    l2.append(chr(l[i]+96))
print("".join(l2))

Submission status: Wrong Answer

Solution code:
l = {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'}
n = int(input())
r = ''

if(n > 26):
  e = n % 26
  f = (n - e) // 26
  if(f > 26):
    r += l[(f % 26)]
  r += l[(f % 26)]
  
r += l[(n % 26)]
print(r)

Submission status: Wrong Answer

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

count = 1
loop = 26

N -= 1

while 1:
  if loop > N:
    break
  count += 1
  loop *= 26

ss = ""

for i in range(count):
  loop /= 26
  tmp = N / loop
  N %= loop
  tmp += 96
  ss += chr((int)(tmp))

ss =ss[0:-1] +  chr((int)(tmp)+1)

print(ss)