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:
# 26^1 = 26
# 26^2 = 676
# 26^3 = 17576
# 702 - 26 = 676

# 1,000,000,000,000,001

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

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

    i = 12
    while i > 1:
        quotient = n // (BASE ** i)
        remain = n % (BASE ** i)

        # if quotient == 2:
        #     result = result + "z"
        #     remain = BASE ** (i-1)
        if quotient >= 1:
            result = result + ALPHABETS[quotient-1]

        n = remain
        i -= 1
    
    quotient = n // BASE
    remain = n % BASE

    # print(quotient)
    # print(remain)

    if quotient == 0:
        result = result + ALPHABETS[remain-1]
    elif remain == 0: 
        result = result + ALPHABETS[quotient-2] + ALPHABETS[remain-1]
    else:
        result = result + ALPHABETS[quotient-1] + ALPHABETS[remain-1]

    print(result)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

current=n
mozi=''
mozi1=''
for i in range(count+1) :
  mozi+='z'
if current==sum :
  print(mozi)
else :
  for i in reversed(range(count+1)) :
    c=current//26**i

    mozi1+=chr(c+k)
    current = current % 26 ** i
  print(mozi1)

Submission status: Wrong Answer

Solution code:
N = int(input())

list = [0] * 11
if N > 26 ** 10:
    list[0] = int(N / 26 ** 10)
    N = int(N % 26 ** 10)
if N > 26 ** 9:
    list[1] = int(N / 26 ** 9)
    N = N % 26 ** 9
if N > 26 ** 8:
    list[2] = int(N / 26 ** 8)
    N = int(N % 26 ** 8)
if N > 26 ** 7:
    list[3] = int(N / 26 ** 7)
    N = int(N % 26 ** 7)
if N > 26 ** 6:
    list[4] = int(N / 26 ** 6)
    N = int(N % 26 ** 6)
if N > 26 ** 5:
    list[5] = int(N / 26 ** 5)
    N = int(N % 26 ** 5)
if N > 26 ** 4:
    list[6] = int(N / 26 ** 4)
    N = int(N % 26 ** 4)
if N > 26 ** 3:
    list[7] = int(N / 26 ** 3)
    N = int(N % 26 ** 3)
if N > 26 ** 2:
    list[8] = int(N / 26 ** 2)
    N = int(N % 26 ** 2)
if N > 26:
    list[9] = int(N / 26)
    N = int(N % 26)
list[10] = N

num2alpha = lambda c: chr(c+64)

result = ''

for i in reversed(range(len(list))):
    if i != 0:
        if list[i] == 0 and list[i -1] == 1:
            list[i] = 26
            list[i-1] = 0
for i in list:
    if int(i) != 0:
        result = result + num2alpha(int(i))
    else:
        if len(result) != 0:
            result = result + num2alpha(int(1))
print(result.lower())

Submission status: Wrong Answer

Solution code:
import itertools
import math
N = int(input())
alphabet = list('abcdefghijklmnopqrstuvwxyz')
num = math.ceil(math.log(N, 26))
cnt = [26**i for i in range(15)]
cumsum = list(itertools.accumulate(cnt))
temp = N - cumsum[num-1]

ans = ''
for i in range(num-1, -1, -1):
    a = temp // 26**i
    ans += alphabet[a]
    temp = temp - a * (26**i)
print(ans)

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('111111110', 'zzzzzzzz')
    ans = ans.replace('11111110', 'zzzzzzz')
    ans = ans.replace('1111110', 'zzzzzz')
    ans = ans.replace('111110', 'zzzzz')
    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()) # + 1

ascii = 'abcdefghijklmnopqrstuvwxyz'

out = ''
l = []
while n > 0:
    l.append(n%26)
    out = str(n%26) + ", " + out
    n = int(n/26)
# print(out)
# print(l)

flg = 0
for i in range(len(l)-1):
    if l[i] != 0:
        l[i] -= 1
    else:
        if i == len(l)-2:
            flg = 1
        l[i+1] = 0
        l[i] = 25

name = ""
for i in range(len(l)-flg):
    name = ascii[l[i]] + name
print(name)

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, 11):
    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'
        else:
            ans+=chr(96 + rem)

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

Submission status: Wrong Answer

Solution code:
import math
import pprint
import fractions
import collections
import itertools
from decimal import *
N=int(input())
l=[pow(26,i) for i in range(13)]
N=N-1
ans=[]
#print(l)
x=[26]
for i in range(2,13):
    x.append(x[len(x)-1]+l[i])
l.sort(reverse=True)
#print(x)
le=0
for i in range(11):
    #print(x[i])
    if N<=x[i]:
        le=i+1
        break
#print(le)
ans=[]
for i in range(le-1,-1,-1):
    d=min(25,N//pow(26,i))
    N=N-d*pow(26,i)
    #print(d)
    ans.append(chr(d+ord("a")))
print("".join(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
while n > 26 ** i :
    n = n - 26 ** i
    i += 1
an = []
while i > 0 :
    k = n // (26 ** (i - 1))
    n -= (26 ** (i-1)) * k
    an.append(k)
    i -= 1
ans = []
for j in an :
    ans.append(chr(96 + j + 1))
del ans[len(ans)- 1]
ans.append(chr(96 + j) )
print(''.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
l = math.log(n, 26)
if l == int(l):
	print (int(l) * "z")
else:
	# pre = 1
	# for i in range(1, int(l)+1):
	# 	pre *= 26
	# 	n -= pre
	r = ""
	while n > 0:
		cur = n % 26
		n //= 26
		if cur == 0:
			cur = 26
		r = chr(ord('a')+cur-1)+r
	print (r)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = ""
words = "abcdefghijklmnopqrstuvwxyz"
while N > 0:
    if N%26 == 0:
        amari = 26
    else:
        amari = N%26
    if N > 26:
        N = (N-N%26)/26
    else:
        N = N-26
    s = words[int(amari-1)]+s
print(s)

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)
    ans.append(alp[b - 1])
    if a >= 26:
        n = a
    else:
        ans.append("a")
        break

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1,12):
    num = (26**i)
    ans += num
    if ans == n:
        print("z"*i)
        exit()
res1,res2 = divmod(n,26)
res = ""
if res1 < 1:
    res = chr(res2+96)
elif res1>26:
    while n>0:
        div,mod = divmod(n,26)
        if mod==0:
            res += 'z'
        else:
            res += chr(mod+96)
        n //= 26
    res = res[::-1]
else:
    res += chr(res1+96)+chr(res2+96) if res2>0 else chr(res1+95)+"z"
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
N = N
s = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
ans = ""
flag = False
for i in range(12):
  j = 11-i
  if N >=26**j:
    flag = True
    aa = N//(26**j)
    ans+=s[aa-1]
    N = N%(26**j)
  elif flag:
    ans+="z"
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
rslt = ""
sub = 1
while N >= 0:
    rslt = chr((N - 1) % 26 + ord('a')) + rslt
    sub *= 26
    N -= sub + (N % 26 - 1)
print(rslt)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=''
while N !=0:
    mod=N%26
    N=N//26
    mod=int(mod)
    if mod==0:
        mod=26
    ans=ans+chr(96+mod)
    if N==1:
        break
ans=ans[::-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = ""
words = "abcdefghijklmnopqrstuvwxyz"
while N > 0:
    if N%26 == 0:
        amari = 26
    else:
        amari = N%26
    if N > 26:
        N = (N-N%26)/26
    else:
        N = N-26
    print(N)
    print(amari)
    s = words[int(amari-1)]+s
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+' ' + out
        X_dumy = int(X_dumy/n)
    return out

a = Base_10_to_n(n,26).split(' ')
a.pop(-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']
ans = ''
for i in range(len(a)):
  ans += alphabet[int(a[i])]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
def num2char(k):
    if k == 0:
        return 'z'
    else:
        return chr(k+96)
name = ''
while N // 26 >= 1:
    name += num2char(N%26)
    N //= 26
name += num2char(N%26)
print(name[::-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
abc = "abcdefghijklmnopqrstuvwxyz"
l = [141167095653376,5429503678976,208827064576,8031810176,308915776,11881376,456976,17576,676,26]
# if n <= 26:
#     print(abc[n-1])
#     exit()
ans = []
for i in range(len(l)):
    if sum(l[i:]) >= n:
        continue
    a = n//l[i]
    if a == 0:
        continue
    n = n%l[i]
    # print(a,n,l[i:],l[i],sum(l[i:]),i)
    if a == 27:
        for z in range(len(l[i:])):
            ans.append("z")
    else:
        ans.append(abc[a-1])

if n != 0:
    ans.append(abc[n-1])

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

Submission status: Wrong Answer

Solution code:
N = int(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',]
name = ''
if N == 1:
    name +='a'
n = N
while n >= 26:
    mod =n % 26
    n = n // 26
    if mod >0:
        name += alpha[mod-1]
    if mod ==0:
        name +='z'
if N%26==0:
    pass
elif N !=1 and N%26!=0:
    name +=alpha[n-1]
print(name[::-1])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math

N = int(input().strip())
#-----

ans = ""

if N <=26:
    digit_str = chr( ord("a")  + (N-1) )
    print(digit_str)
    sys.exit()


while N > 0:
    digit_int = (N-1) % 26
    digit_str = chr( ord("a")  + digit_int )
    ans += digit_str
    
    N = N // 26

print(ans[::-1])

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)

  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 sys
# input = sys.stdin.readline
# import re
import itertools

def main():
    n = int(input())
    borders = {702: 'zz', 18278: 'zzz', 475254: 'zzzz', 12356630:'zzzzz', 321272406:'zzzzzz', 8353082582:'zzzzzzz', 217180147158:'zzzzzzzz', 5646683826134:'zzzzzzzzz', 146813779479511: 'zzzzzzzzzz'}
    if n in borders:
        print(borders[n])
        exit()
    v = 26
    for l in range(2, 15):
        v = (26 ** l) + v
        if v >= n:
            break
    s = 'abcdefghijklmnopqrstuvwxyz'
    a = ''
    while True:
        i = n % 26
        n //= 26
        a += s[i-1]
        if n in borders:
            a += borders[n]
            break
        if n == 0:
            break
    print(a[:l][::-1])



def count_tento(l, cur):
    count = 0
    for v in l:
        if v > cur:
            count += 1
    return count

def input_list():
    return list(map(int, input().split()))

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

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

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

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

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


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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input().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
if keta == 0:
    print(dic[n])
else:
    for i in range(keta, 0, -1):
        sho = n // (26 ** i)
        amari = n % (26 ** i)
        ans += dic[amari % 26]
        n %= 26 ** i
    print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[]
temp=0
test=1
for i in range(1,12):
	test+=26**i
	if N<test:
		temp=i
		break
#print(temp)

for i in range(0,temp):
	for h in range(1,27):
		if (26**(temp-1-i))*(h+1)>N:
			l.append(chr(h+96))
			N-=(26**(temp-1-i))*h
			#print(N,l)
			break
		if h==26:
			l.append(chr(h+96))
			N-=(26**(temp-1-i))*h
			#print(N,l)
		


print("".join(l))

Submission status: Wrong Answer

Solution code:
n = int(input())
def B(X, n):
    X_dumy = X
    ln = []
    while X_dumy>0:
        ln.append(int(X_dumy%n))
        X_dumy = int(X_dumy/n)
    ln.reverse()
    return ln
ln = B(n, 26)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
q = []
for i in ln:
    if i != 0:
        q.append(a[i - 1])
print(''.join(q))

Submission status: Wrong Answer

Solution code:
a = int(input())
div_list = [(26**i) for i in range(11)]

ans = [a//div for div in div_list]
ans = [a %26 for a in ans]
for i in range(len(div_list)):
    las = ans.pop(-1)
    if las!=0:
        ans.append(las)
        break
for i in range(len(ans)-1):
    s = ans[i]
    if s==0:
        ans[i] = 26
        ans[i+1] = ans[i+1] - 1
las = ans.pop(-1)
if las!=0:
    ans.append(las)
answer = [chr(a+96) for a in ans[::-1]]
print(''.join(answer))

Submission status: Wrong Answer

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

an =[]
if n<27:
    print(chr(n+96))
    sys.exit()
for i in range(11):
    if 26**(10-i)<=n:
        wk = n//26**(10-i)
        n=n%26**(10-i)
        an.append(chr(wk%26+96))

print(''.join(an))

Submission status: Wrong Answer

Solution code:
n=int(input(''))
a=1
t=[]
l=['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=n-1
while(1):
    b=n%(26)
    t.append(b)
    n=n-b-1
    n=int(n/26)
    if n==0:
        break
    
t.reverse()

s=''
for a in range(len(t)):
    s=s+l[t[a]]

print(s)

Submission status: Wrong Answer

Solution code:
import math
import sys


def A(x):
  if ord(x) - ord('a') >= 0:
    print('a')
  else:
    print('A')


def B(n, k, p_list):
  p_list = sorted(p_list)
  print(sum(p_list[:k]))


def _get_base_x(n, x):
  # n = n + int(math.floor(n / 26.0))
  if n % 26 == 0:
    n -= 26
  # print(n)
  a = [
      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
      'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
  ]
  b = []
  while True:
    s = n // x
    y = n % x
    b = b + [y]
    if s == 0:
      break
    n = s
  b.reverse()
  # print(b)
  ret = []
  for i in b:
    ret.append(a[i - 1])
  print(''.join(ret))


def C(x):
  _get_base_x(x, 26)


def main():
  # letter = input()
  # A(letter)
  # for x in ['A', 'Z', 'a', 'z']:
  #   A(x)

  # n, k = map(int, input().split())
  # p_list = map(int, input().split())
  # B(n, k, p_list)
  C(int(input()))
  # C(27)
  # C(702)
  # C(703)
  # C(18279)
  # C(475254)
  # n = 27
  # n = 475255
  # for x in range(26):
  #   C(n + x)


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:
        res[-1] -= 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:
#!/usr/bin/env python3

num2alpha = lambda c: chr(c+64)

n = int(input())

r_num = []
s = n
while s > 0:
    r_num.append(s%26)
    s = s // 26

r = ""
for x in r_num[::-1]:
    r += num2alpha(x)

print(r.lower())

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 = "abcdefghijklmnopqrstuvwxyz"
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-1])
    else:
        if len(ret) > 0:
            ret.append('z')
    na -= sho * (26**i)
if ama > 0:
    ret.append(az[ama-1])
if (ret[0] == 'z'):
    del ret[0]
re = "".join(ret)
print(re)

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = N
cnt=1
if N%26 == 0:
    while True:
        if N == 26:
            cnt = 1
            break
        elif tmp//26 < 28:
            cnt += 1
            break
        else:
            tmp = tmp//26
            cnt += 1
else:
    while True:
        if tmp//26 < 1:
            break
        else:
            tmp = tmp//26
            cnt += 1
#print(cnt)
res = ''
next = N
for i in range(cnt):
    tmp = next%26
    next = next//26
#    print("tmp,next:",tmp,next)
    if tmp == 0:
        res += 'z'
        next -= 1
    elif tmp+96>122:
        res += chr((tmp+96)-26)
    elif tmp+96<97:
        res += chr((tmp+96)+26)
    else:
        res += chr(tmp+96)
print(res[::-1])

Submission status: Wrong Answer

Solution code:
import string


n=int(input())
car=""
sum=0
cnt=1
alpha_ls=list(string.ascii_lowercase)
while True:
    if 26**(cnt-1)<n and n<=26**cnt:
        break
    cnt+=1
for i in range(cnt):
    car+=alpha_ls[n//(26**(cnt-i-1))-1]
    n=n%(26**(cnt-i-1))
print(car)

Submission status: Wrong Answer

Solution code:
n = int(input())

keta = 0
tmp = 26
beki = [26]

while True:
    if n <= beki[-1]:
        break
    tmp *= 26
    beki.append(beki[-1] + tmp)
    keta += 1
print(f'beki={beki}')
n_tmp = n
ans_num = []

n_tmp -= beki[keta - 1] + 1
for i in range(keta):
    waru = 26**(keta - i)
    print(f'n_tmp={n_tmp}, waru={waru}')
    x = (n_tmp) // waru
    ans_num.append(x)
    n_tmp -= x * waru
    print(x,n_tmp)

ans_num.append(n_tmp)
print(f'keta={1+keta}')
ans = ''

print(f'ans_num={ans_num}, n_tmp={n_tmp}')
for d in ans_num:
    ans += chr(d + 97)

if n <= 26:
    print(chr(n + 96))
else:
    print(ans)

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
Toname.append(number)
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:
N = int(input())
name = ''
i = 0
a = 0
while True:
    i += 1
    a = a + 26**i
    if N <= a:
        break
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())
 
S = str()
 
import math
 
K = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 1000000000000005]

if N < 26:
	S=S+chr(96+N)
	print(S)
	exit()

if K.count(N) > 0:
	for i in range (0, K.index(N)+1):
		S=S+'z'
	print(S)
	exit()

import bisect
P = bisect.bisect_right(K, N)
Mel = N- K[P-1]
 
for i in range (0, P):
	K = Mel//(26**(P-i))
	Mel = Mel-K*(26**(P-i))
	S=S+chr(97+K)

print(S)

Submission status: Wrong Answer

Solution code:
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

print(count+1)
print(sum)
current=n
mozi=''
mozi1=''
for i in range(count+1) :
  mozi+='z'
if current==sum :
  print(mozi)
else :
  for i in reversed(range(count+1)) :
    c=current//26**i
    print(c)
    mozi1+=chr(c+k)
    current = current % 26 ** i
  print(mozi1)

Submission status: Wrong Answer

Solution code:
n = int(input())
final = []
while 1:
    q = n//26
    r = n%26
    final.append(chr(ord('a')+(r-1)))
    n = q
    if q == 0:
        break
ans=''
for i in final:
    ans+=i
print(ans[::-1])

Submission status: Wrong Answer

Solution code:
N = int(input())

ansList = []

for i in range(11):
    ansList.append(N // 26 ** (10 - i))
    N = N % 26 ** (10 - 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)

kotaeList = []

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

    if(0 not in ansList[1:]):
        break
'''
for index, hoge in enumerate(ansList):
    if(hoge == 0):
        kotaeList.append(26)
        kotaeList[-2] -= 1
    else:
        kotaeList.append(hoge)
'''
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:
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())


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

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

print(string)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
s=0
c=1
s1=0
l=[]
for i in range(11):
    k=pow(26,c)
    s+=k
    l.append(k)
    if(s>=n):
        break
    c+=1
ans=''
c1=0
for i in range(c-1,0,-1):
    if(n//l[i-1]==0):
        ans+='a'
    else:
        ans+=chr((n//l[i-1])+96)
    n=n%l[i-1]
if(n==0):
    ans+='z'
else:
    ans+=chr((n%26)+96)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = []
order = 0
while True:
  if n //  26**order > 0:
    order = order + 1
  else:
    break
for i in range(order,0,-1):
  number = n //(26**(i-1))
  n = n - number*26**(i-1)
  ch = chr(96 + number)
  numbers.append(ch)
print(''.join(numbers))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = [chr(ord('a') + i) for i in range(26)]

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

B = math.log(N, 26)
B = math.ceil(B)
#print(B)

C = [26]
for i in range(2, B):
        D = 26**i
        C.append(D)

#print(C[::-1])

ans = []
for i in C[::-1]:
    D = int(N // i)
#    print(D)
    ans.append(A[D - 1])
    N %= i
    if N <= 26:
        ans.append(A[N-1])
        print(''.join(ans))
        exit()
#    else:
#        print(N)

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,12):
  
  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]==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))