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: Accepted

Solution code:
import sys
input=lambda :sys.stdin.readline().rstrip()

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

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

Submission status: Accepted

Solution code:
from collections import deque

def main():
    N = int(input())
    l = deque()
    mozi = list("abcdefghijklmnopqrstuvwxyz")
    a, b = divmod(N, 26)
    N -= 1

    while True:
        a, b = divmod(N, 26)
        l.appendleft(mozi[b])
        N = a
        N -= 1
        if a == 0:
            break

    print("".join(l))


main()

Submission status: Accepted

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)
print(str.lower(num2alpha(n)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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())
res = num2alpha(n)
print(res.lower())

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    n = N
    ans = []
    while n > 0:
        n -= 1
        remain = n % 26
        ans.append(chr(ord('a') + remain))
        n //= 26
    print(''.join(reversed(ans)))
main()

Submission status: Accepted

Solution code:

n = int(input())
ans = ""
while n > 0:
    s = n % 26 
    if s == 0:
        s = "z"
    else:        
       s = chr(s+ord("a")-1)
    ans += s
    n = (n-1)//26
print(ans[::-1])

Submission status: Accepted

Solution code:
from math import *

N = int(input())
name = ""

# Remove smaller names
size = 0
while 26**size <= N:
    N -= 26**size
    size += 1

for pos in range(size):
    rem = N % 26
    name = chr(ord('a') + rem) + name
    N //= 26

print(name)

Submission status: Accepted

Solution code:
import string

N = int(input()) - 1
ss = string.ascii_lowercase

ans = ""

while N >= 0:
  ans += ss[N % 26]
  N = N // 26 - 1
  if N < 0:
    break

print(ans[::-1])

Submission status: Accepted

Solution code:
import string 
def convertbase26(N):
    n=26
    X=N-1
    if (int(X//n)):
        return convertbase26(int(X//n))+string.ascii_lowercase[X%n]
    return string.ascii_lowercase[X%n]


N=int(input())
rank=1
base=0
"""
while(1):
    base=26**(rank)+1
    if base>N:
        break
    N-=26**(rank-1)
"""
print( convertbase26(N) )

Submission status: Accepted

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

#output
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)

print(num2alpha(N).lower())

Submission status: Accepted

Solution code:
n = int(input())
ans = ""
while n:
    n -= 1
    q, r = divmod(n, 26)
    ans += chr(ord("a")+r)
    n = q
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

name = []
while N:
    name.append(N%26)
    N = (N-1)//26

name = name[::-1]
ans = "".join(map(lambda x : chr(x+96), name))
ans = ans.replace('`','z')
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = ''
while True:
    amari = N % 26
    N = N//26

    if amari == 0:
        ans = 'z'+ans
        N -= 1
    else:
        ans = chr(96+amari)+ans

    if N == 0:
        break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
N = N
s = "zabcdefghijklmnopqrstuvwxyz"
ans = []
while True:
    temp = N % 26
    ans.append(s[temp])
    if temp == 0:
        N = N - 1
    N = N // 26
    if N <= 0:
        break

ans.reverse()
print("".join(ans))

Submission status: Accepted

Solution code:
n = int(input())
l = []
while(n > 0):
  n -= 1
  l.append(chr(97+(n%26)))
  n = n//26
for i in l[::-1]:
    print(i,end="")
print("")

Submission status: Accepted

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)

if __name__ == "__main__":
    N = int(input())
    N = num2alpha(int(N)).lower()
    print(N)

Submission status: Accepted

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)

a = num2alpha(N)
print(a.lower())

Submission status: Accepted

Solution code:
n = int(input())

s = ''
while (n > 0):
    r = n % 26

    if r == 0:
        s = 'z' + s
        n = (n - 26) // 26
    else:
        c = chr((r - 1) + ord('a'))
        s = c + s
        n //= 26

print(s)

Submission status: Accepted

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

for a in range(11,-1,-1):
  if n > (26*pow(26,a)-26)/(26-1):
    break
n -= (26*pow(26,a)-26)/(26-1)+1
n = int(n)
a += 1

# print(n)

ans = []
for i in range(a):
  s = n%26
  ans.append(chr(97+s))
  n //= 26
print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
N=int(input())
#N=1000000000000001
ans=''
alp=list('abcdefghijklmnopqrstuvwxyz')

while N != 0:
  N,mod=divmod(N-1,26)
  ans=alp[mod]+ans
print(ans)
#27 -> aa  26 + 1

Submission status: Accepted

Solution code:
n = int(input())


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


print(num2alpha(n))

Submission status: Accepted

Solution code:
N = int(input())
#N -= 1 #0index
ans = ""

while N > 0:
  N-=1
  a = N%26
  N = N//26
  ans = chr(int(a+97))+ans
  #print(ans)

print(ans)

Submission status: Accepted

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())
ans = num2alpha(n)
ans = ans.lower()
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
# n = 703
# n = 123456789
n -= 1
char = ['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']

s = ""
f = 0
while True:
    s = s + char[n % 26]
    n = n // 26 - 1
#     print(n)
    if n <= -1:
        break
print(s[::-1])

Submission status: Accepted

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)

print(num2alpha(int(input())).lower())

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce, lru_cache  # @lru_cache(None)
from fractions import gcd
import sys  # def input(): return sys.stdin.readline().rstrip() # sys.setrecursionlimit(10**6)

A = [26**i for i in range(1, 13)]
Acc = list(accumulate(A))
n = int(input())
l = bisect_left(Acc, n)
# a = ord("a")

ANS = []
for i in range(l+1):
    tmp = n % 26 if n % 26 != 0 else 26
    ANS.append(chr(ord("a")-1+tmp))
    n -= tmp
    n //= 26
ANS.reverse()
print("".join(ANS))

Submission status: Accepted

Solution code:
N = int(input())

name = list()
while N >= 1:
    num_name = N % 26
    if num_name == 0:
        name.append("z")
    else:
        name.append(chr(ord("a") + num_name - 1))
    N //= 26
    if num_name == 0:
        N -= 1

for i in range(len(name)-1, -1, -1):
    print(name[i], end = "")

Submission status: Accepted

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']
n=int(input())
current=0
length=0
while current<n:
  current+=26**(length+1)
  length+=1
current-=26**(length)
n-=current+1
ans=[]
for i in range(length):
  ans.append(alphabets[((n%(26**(i+1)))-n%(26**i))//(26**i)])
ans.reverse()
print(''.join(ans))

Submission status: Accepted

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

def alphabet_decimal(v):
    quotient = math.floor(v / len(ALPHABET))
    surplus = v % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < v:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

n = int(input())
#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']
print(alphabet_decimal(n))

Submission status: Accepted

Solution code:
import heapq

n = int(input())

s = []
while (n != 0):

    if(n == 26):
        s.append("z")
        break

    temp = n % 26
    if(temp == 0):
        temp = 26
    s.append(chr(temp + 96))
    n = (n - temp) // 26

s.reverse()
s = "".join(s)
print(s)

Submission status: Accepted

Solution code:
n = int(input())
lst = []
while n:
  mod = n % 26
  if mod:
    lst += [chr(96 + mod)]
    n = n // 26
  else:
    lst += ['z']
    n = (n - 26) // 26
lst.reverse()
print(''.join(lst))

Submission status: Accepted

Solution code:
def toString(n):
    if n <= 26:
        return chr(64 + n)
    elif n % 26 == 0:
        return toString(n // 26-1) + chr(90)
    else:
        return toString(n // 26) + chr(64 + n % 26)

N = int(input())
Alpha = toString(N)
alpha = Alpha.lower()
print(alpha)

Submission status: Accepted

Solution code:
from math import *

n=int(input())
ans=[]
while n>0:
	x=n%26
	if x==0:
		x=26
		n-=1
	ans.append(x)
	n=n//26

ans.reverse()
f=''
for i in ans:
	f=f+chr(96+i)

print(f)

Submission status: Accepted

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)

print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
 
    
    
def solve(N):
    arr = [chr(ord('a')+i) for i in range(26)]
    num_digit = 1
    tmp = N
    while tmp-26**num_digit>=0:
        tmp -=26**num_digit
        num_digit+=1
    ans = ''
    while num_digit:
        idx = tmp // 26**(num_digit-1)
        tmp = tmp % 26**(num_digit-1)
        ans+= arr[idx]
        num_digit-=1
    print(ans)
N = rri()
solve(N-1)

Submission status: Accepted

Solution code:
def aa(num):
    if num <= 26:
        return chr(96+num)
    elif num % 26 == 0:
        return aa(num//26-1)+chr(122)
    else:
        return aa(num//26)+chr(96+num%26)


n =int(input())
x = aa(n)
print(x)

Submission status: Accepted

Solution code:
N = int(input())

x = 1
for d in range(1, 15):
  x *= 26
  if N <= x:
    break
  else:
    N -= x
    
#Ans : d digits, N-th number
N -= 1
ans = ''
for i in range(d):
  r = N % 26
  ans = chr(ord('a') + r) + ans
  N //= 26

print(ans)

Submission status: Accepted

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)

ans=num2alpha(N)
print(ans.lower())

Submission status: Accepted

Solution code:
from string import ascii_lowercase


def main():
    n = int(input())
    answer = []
    while n > 0:
        answer.append(ascii_lowercase[n % 26 - 1])
        if n % 26:
            n //= 26
        else:
            n = (n - 1) // 26
    print("".join(answer[::-1]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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())
a = num2alpha(N)
print(a.lower())

Submission status: Accepted

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

ans=""

alp="abcdefghijklmnopqrstuvwxyz"

def f(n):
	global ans
	ans=alp[n%26]+ans
	if n>=26: f(n//26-1)
	return(ans)


print(f(N))

Submission status: Accepted

Solution code:
import sys                                                                                                                                                                                                  
                                                                                                                                                                                                            
l = sys.stdin.readline().rstrip('\n').split(' ')                                                                                                                                                            
N = int(l[0])                                                                                                                                                                                               
                                                                                                                                                                                                            
digits = 1                                                                                                                                                                                                  
                                                                                                                                                                                                            
while True:                                                                                                                                                                                                 
    ub = 26 ** digits                                                                                                                                                                                       
    if N <= ub:                                                                                                                                                                                             
        break                                                                                                                                                                                               
    N -= ub                                                                                                                                                                                                 
    digits += 1                                                                                                                                                                                             
                                                                                                                                                                                                            
ans = ''                                                                                                                                                                                                    
N -= 1                                                                                                                                                                                                      
                                                                                                                                                                                                            
for pos in range(digits):                                                                                                                                                                                   
    offset = N % 26                                                                                                                                                                                         
    digit = chr(ord('a') + offset)                                                                                                                                                                          
    ans = digit + ans                                                                                                                                                                                       
    N //= 26                                                                                                                                                                                                
                                                                                                                                                                                                            
print(ans)

Submission status: Accepted

Solution code:
def num2alpha(num):
    if num <= 26:
        return chr(96+num)
    elif num % 26 == 0:
        return num2alpha(num//26-1)+chr(122)
    else:
        return num2alpha(num//26)+chr(96+num % 26)


def main():
    N = int(input())
    print(num2alpha(N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = int(input())

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

print(this(S).lower())

Submission status: Accepted

Solution code:
n = int(input())

nn = n // 26
amari = n % 26

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

print(ans.lower())

Submission status: Accepted

Solution code:
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	N = int(input())
	alpha = [chr(i) for i in range(97, 123)]
	cnt = 0
	var = None
	for i in range(1, 100):
		if N <= 26 ** i:
			var = i
			break
		N -= 26 ** i

	N -= 1
	# print(N)
	# print(var)
	ans = ""
	for i in range(var):
		ans += alpha[N % 26]
		N = int(N // 26)

	print(ans[::-1])





if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True

    @staticmethod
    def fact(N):
        res = {}
        tmp = N
        for i in range(2, int(N ** 0.5 + 1) + 1):
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if cnt > 0:
                res[i] = cnt
        if tmp != 1:
            res[tmp] = 1
        if res == {}:
            res[N] = 1
        return res


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def to_26(X):
    X -= 1
    if int(X / 26):
        return to_26(int(X / 26)) + string.ascii_lowercase[X % 26]
    else:
        return string.ascii_lowercase[X % 26]


def solve():
    N = Scanner.int()
    print(to_26(N))


def main():
    # sys.stdin = open("sample.txt")
    # T = Scanner.int()
    # for _ in range(T):
    #     solve()
    # print('YNeos'[not solve()::2])
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import string

N = int(input())


def number_to_base(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]


def get_dog_name(N):
    N -= 1
    for i in range(1, 14):
        num = 26 ** i
        if N >= num:
            N -= num
            continue
        base26 = number_to_base(N, 26)
        name = "".join([string.ascii_lowercase[i] for i in base26])
        return ("a" * i)[:-len(name)] + name


print(get_dog_name(N))

Submission status: Accepted

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)

print(num2alpha(int(input())).lower())

Submission status: Accepted

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)
def resolve():
    s = int(input())
    print(str.lower(num2alpha(s)))
resolve()

Submission status: Accepted

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


def solve(N: int):
    n = N
    ans = ""
    
    while n>0:
        mod = (n-1) % 26
        ans = chr(97+mod) + ans
        n = (n-mod)//26

    print(ans)
    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

res = []
a = 26
while N > 0:
    x = N%a
    if x == 0:
        res.append(26)
        N -= a
        N //= a
    else:
        res.append(x)
        N //= a

res.reverse()
res = [chr(0x60+r) for r in res]
print("".join(res))

Submission status: Accepted

Solution code:
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    def moji_list(a, b):
        # アルファベット小文字 → (97, 123)
        # アルファベット大文字 → (65, 91)
        # 半角数字 → (48, 58)
        # ひらがな → (12353, 12436)
        # カタカナ → (12449, 12532+1)
        # 全角数字 → (65296, 65306)
        return [chr(i) for i in range(a, b)]


    n = int(readline())
    al = ['z'] + moji_list(97, 123)
    ans = ''
    for i in range(1, 10 ** 6):
        n, check = divmod(n, 26)
        if check == 0:
            n -= 1
        ans += al[check]
        if n == 0:
            print(ans[::-1])
            break


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)


def main(input, print):
    n = int(input())
    ans = ''
    n -= 1
    ans += chr(ord('a')+n % 26)
    now = n // 26
    while now > 0:
        now -= 1
        ans = chr(ord('a')+now % 26) + ans
        now = now//26
    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)


def read():
    N = int(input().strip())
    return N,


def solve(N):
    C = "abcdefghijklmnopqrstuvwxyz"
    name = []
    while N > 0:
        c = C[(N-1) % 26]
        name.append(c)
        N = (N-1) // 26
    return "".join(name)[::-1]


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

Solution code:
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===
def main():
    n = ni()

    diver = 26
    ans = []
    while n > 0:
        n -= 1
        ans.append(chr(97 + n % diver))
        n //= diver

    ans.reverse()
    print(*ans, sep="")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    a = 26
    ans = []
    for i in range(100000):
        c = N % a
        if c == 0:
            c = 26
            N -= 1
        N //= a
        ans.append(chr(ord('a')+c-1))
        if N == 0:
            break
    return ''.join(reversed(ans))


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()

Submission status: Accepted

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)

res = num2alpha(n)

print(res.lower())

Submission status: Accepted

Solution code:
n = int(input())

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

print(al(n).lower())

Submission status: Accepted

Solution code:
n = int(input())

name = ''
while n > 0:
    n -= 1
    name += chr(ord('a') + (n % 26))
    n //= 26

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

Submission status: Accepted

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)
def main():
  a=int(input())
  print(num2alpha(a).lower())

main()

Submission status: Accepted

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

def solve():
    N = int(readline())

    ans = ''

    alphas = [chr(i + ord('a')) for i in range(26)]

    while N > 0:
        r = N % 26
        if r == 0:
            ans = alphas[-1] + ans
            N = N // 26 - 1
        else:
            ans = alphas[r - 1] + ans
            N = N // 26
    
    print(ans)


solve()

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
while N>0:
    n = N%26
    if n==0:
        ans += "z"
        N -= 1
    else:
        ans += chr(ord("a") + n-1)
    N //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
while N > 0:
  surplus = N % 26
  if surplus == 0:
    ans = 'z' + ans
    N //= 26
    N -= 1
  else:
    ans = chr(surplus + 96) + ans
    N //= 26
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(num2alpha(n))