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 math as mt
import collections as cc
I=lambda:list(map(int,input().split()))
ans=[]
prev=0
for i in range(1,15):
    ans.append(26**i+prev)
    prev+=26**i
    
n,=I()
p=0
s='abcdefghijklmnopqrstuvwxyz'
f={}
for i in range(1,27):
    f[i]=s[i-1]
for i in range(len(ans)):
    p+=1
    if n<=ans[i]:
        break
an=''
f[0]='z'
for i in range(p):

    an+=f[n%26]
    if n%26:
        n//=26
    else:
        n//=26
        n-=1
    
print(an[::-1])

Submission status: Accepted

Solution code:
n = int(input())
l = [26 ** j for j in range(1, 15)]
for i in range(15):
  if n <= sum(l[:i]):
    x = i #文字数
    if i == 1:
      y = n - 1 #何個目か
    else:
      y = n - sum(l[:i-1]) - 1 #何個目か
    break
  else:
    pass
'''
m = []
for i in range(x):
  z = n % 26
  m.insert(0, z+96)
  n = n // 26

for i in range(len(m)):
  m[i] = chr(m[i])

print(''.join(m))
'''
m = []
for i in range(x):
  z = y % 26
  m.insert(0, z+97)
  y = y // 26
for i in range(len(m)):
  m[i] = chr(m[i])

print(''.join(m))

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:
def solve():
    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())

if __name__ == "__main__":
    N = int(input())
    solve()

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:
n=int(input())

max_num=1000000000000001
cnt=0
i=1
while True:
    next_cnt=cnt+26**i
    if n<=next_cnt:
        break
    i+=1
    cnt=next_cnt
index=n-cnt
ans=""
for j in range(i):
    k=0
    while True:
        if (26**(i-j-1))*k+1<=index<=(26**(i-j-1))*(k+1):
            ans+=chr(k+97)
            index-=(26**(i-j-1))*k
            #print(index,k)
            break
        k+=1

print(ans)

Submission status: Accepted

Solution code:
Nmax = 1000000000000001
c = "abcdefghijklmnopqrstuvwxyz"

a = ""
N = int(input())
N = N-1
mm = 26
if N == 0:
  print("a")
  exit(0)
#
while N > 0:
  if N < mm:
    break
  N -= mm
  mm *= 26
#

while mm >= 26:
  mm = mm //26
  m = N // mm
  N = N % mm
  a = a + c[m]
#
print(a)

Submission status: Accepted

Solution code:
from math import log
alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
N = int(input())
if N == 1: print("a")
elif N == 2: print("b")
else:
    N -= 1
    shou = N
    for i in range(N):
        if 26 * (26 ** i - 1) // 25 > N:
            shou -= 26 * (26 ** (i - 1) - 1) // 25
            break
    ans = ["a"] * i
    flag = 0
    #print(shou,ans)
    while shou > 0:
        ans[flag] = alphabet[shou % 26]
        shou //= 26
        flag += 1
        #print(ans,shou)
    ans.reverse()
    for i in ans: print(i,end = "")
    print()

Submission status: Accepted

Solution code:
N = int(input())
name = []
alphabet = [chr(i) for i in range(97, 97+26)]

while 0 < N:
    num = N // 26
    mod = N % 26
    if 26 < num:
        if mod == 0:
            name += alphabet[-1]
            num -= 1
        else:
            name += alphabet[mod-1]
    else:
        if mod == 0:
            name += alphabet[-1]
            num -= 1
        else:
            name += alphabet[mod-1]
    N = num

name.reverse()
print(*name, sep='')

Submission status: Accepted

Solution code:
n = int(input())
amari = 0
name = []
a = "abcdefghijklmnopqrstuvwxyz"

while n >= 1 :
    amari = n % 26    
    if amari == 0:
        amari = 26
    name.insert(0, a[int(amari-1)])
    n = (n - amari) / 26

ans = ''.join(name)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
k=n
keta=1
x=26
while k>x:
    k-=x
    keta+=1
    x*=26

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

for i in reversed(range(1,keta)):
    s=(k-1)//(26**i)
    k-=s*(26**i)
    l.append(book[s])

l.append(book[k-1])
print("".join(l))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import string
import sys
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)])
def main():
    N = int(input())
    ans = alphabet_decimal(N).lower()
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from string import ascii_lowercase

n = int(input())
s = ascii_lowercase
ans =''
while True:
    x = n%26
    ans = s[x - 1] + ans
    n //= 26
    if x == 0:
        n -= 1
    if n == 0:
        break
print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input().strip()) 
s = chr((n - 1) % 26 + 97)
while n >= 27:
  n = (n - 1) // 26
  s = chr((n - 1) % 26 + 97) + s
print(s)

Submission status: Accepted

Solution code:
"""
~~ Author : Bhaskar
~~ Dated : 10~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")
input = lambda : sys.stdin.readline()

def solve():
    n = int(sys.stdin.readline())
    # print((n-1)%26)
    ans = ""
    while n:
        ans += ch[((n-1) % 26)]
        n = n - 1
        n //= 26
    print(ans[::-1])


if __name__ == "__main__":
    try:
        sys.stdin = open('input.txt','r')
        sys.stdout = open('output.txt','w')
    except:
       pass
    solve()

Submission status: Accepted

Solution code:
N = int(input())

def get_name(N):

    alphabets = [chr(i) for i in range(97, 97+26)]
    length = len(alphabets)

    shou = (N - 1) // length
    amari = N % length

    if N <= 26:
        return alphabets[amari-1]
    else:
        return get_name(shou) + get_name(amari)

print(get_name(N))

Submission status: Accepted

Solution code:
def main(n):

    if (n <= 26):
        ans.append(chr(96 + n))
        ans.reverse()
        print(''.join(ans))
    elif( n % 26 == 0):
        ans.append(chr(122))
        main(n//26 - 1)
    else:
        ans.append(chr(96 + n%26))
        main(n//26)
        

n = int(input())
ans = []

main(n)

Submission status: Accepted

Solution code:
n=int(input())
al=[chr(ord('a') + i) for i in range(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)
print(num2alpha(n).lower())

Submission status: Accepted

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


def main():
    N = int(input().strip())
    ans = ""

    while N > 0:
        N, m = divmod(N, 26)
        if m == 0:
            N -= 1
            ans = chr(0x7A) + ans
        else:
            ans = chr(0x60 + m) + ans

    return ans


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
abc = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while N > 0:
    ans = abc[N % 26 - 1] + ans
    N = (N - ((N - 1) % 26) - 1) // 26
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

a=[]
for i in range(20):
    if N%26==0:
        s=26
        N=int(N/26)-1
    else:
        s=int(N%26)
        N=int(N/26)
    
    a.append(s)
    if N<1:
        break

a=a[::-1]
for i in range(len(a)):
    a[i]=chr(a[i]+96)

print("".join(a))

Submission status: Accepted

Solution code:
import numpy as np
import math
import collections
import bisect
import itertools


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:
N = int(input())

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

print(str.lower(num10to26(N)))

Submission status: Accepted

Solution code:
N = int(input())

name = []

def func(num):
    global name
    if num%26 == 0:
        name.insert(0, "z")
        if (num-26)//26 > 0:
            func((num-26)//26)
    else:
        name.insert(0, chr(96 + num%26))
        if num//26 > 0:
            func(num//26)

func(N)

print("".join(name))

Submission status: Accepted

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

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:
To_Acill = 96
 
N = int(input())
 
ans = []
 
jou26 = 1
while N > 0:
    tmp = N % (jou26*26)
    if tmp ==0:
        tmp =26*(jou26)
        ans.append(chr(To_Acill + 26))
    else:
        ans.append(chr(To_Acill + tmp//jou26))
    N = N-tmp
    jou26 = jou26*26
 
print("".join(reversed(ans)))

Submission status: Accepted

Solution code:
n = int(input())
alp = [chr(ord('a') + i) for i in range(26)]
res = []
x = 26
while n>0:
    n,r = divmod(n,x)
    if r==0:
        n -=1
    res.append(alp[r-1])
res = res[::-1]
print(*res,sep='')

Submission status: Accepted

Solution code:
n = int(input())
a = "abcdefghijklmnopqrstuvwxyz"
s = []
while n > 0:
    s.append(a[n%26 - 1])
    if (n % 26 == 0):
        n = n // 26 -1
    else:
        n //= 26
print(''.join(s[::-1]))

Submission status: Accepted

Solution code:
import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7


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

n = INT()

temp = 26
count = 0

while True:
    count += 1
    if n < temp:
        break
    n -= temp
    temp *= 26

n-= 1

ans = [0]*count
for i in range(count-1, -1, -1):
    kotae = n//(26**i)
    amari = n%(26**i)
    ans[i] = kotae
    n = amari

if ans[-1] == -1:
    ans = ans[:count-1]
for i in range(len(ans)-1, -1, -1):
    print(alp[ans[i]], end="")

Submission status: Accepted

Solution code:
c = ['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())
a = []
s = ""
#print(n)
while n > 26:
  r = n % 26
  if (r == 0):
    r = 26
    
  a.append(r)
  n -= r
  n = int(n/26)
  
a.append(n)
a.reverse()
#print(a)

for i in range(len(a)):
  s = s + c[a[i]-1]
  
print(s)

Submission status: Accepted

Solution code:
n = int(input())

ans = ''
while n > 26:
    n, mod = divmod(n-1, 26)
    ans += chr(ord('a') + mod)


ans += chr(ord('a') + (n-1) % 26)
print(ans[::-1])

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N = getN()

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:
def convertion(n):
    result = ""
    while n != 0:
        n -= 1
        m = n % 26
        n = n // 26
        result = chr(ord('a') + m) + result
    return result

n = int(input())
print(convertion(n))

Submission status: Accepted

Solution code:
alp = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())
ans = []

while N > 26:
    if N%26 != 0:
        ans.append(alp[N%26-1])
        N = N // 26
    else:
        ans.append(alp[N%26-1])
        N = N // 26 -1
ans.append(alp[N-1])

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

Submission status: Accepted

Solution code:
n = int(input())
alpha = [chr(x) for x in range(ord('a'), ord('z')+1)]
name = ''
while n:
  n -= 1
  r = int(n%26)
  n = n // 26
  name += alpha[r]
print(name[::-1])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
n-=1

ans = []

def Base_10_to_n(X, n, ans):
    if (int(X/n)):
        ans.append(chr(ord('a')+(X%n)))
        return Base_10_to_n(int(X/n)-1, n, ans)+str(X%n)
    ans.append(chr(ord('a')+(X%n)))
    return str(X%n)

num  = Base_10_to_n(n,26, ans)

ans.reverse()

print(*ans,sep='')

Submission status: Accepted

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

n = int(input())
amari = []
alpha = 'abcdefghijklmnopqrstuvwxyz'

while True:
    if (n-1) < 26:
        amari.insert(0, alpha[n-1])
        break
    else:
        ama = (n-1) % 26
        amari.insert(0, alpha[ama])
        n = (n -1)//26

print("".join(amari))

Submission status: Accepted

Solution code:
N = int(input())
A = [chr(ord('a') + i) for i in range(26)]
answer = ''
while N > 0:
    answer = A[N%26-1]+answer
    if N%26==0:
        N = N//26-1
    else:
        N = N//26
print(answer)

Submission status: Accepted

Solution code:
def f(x):
    x -= 1
    if (int(x / 26)):
        return f(int(x/26)) + chr((x % 26) + 97)
    return chr((x % 26) + 97)


n = int(input())

print(f(n))

Submission status: Accepted

Solution code:
n=int(input())
x=[]
for i in range(26):
	x.append(chr(ord('a')+i))

s=""
while(n>0):
	a=n%26
	if(a==0):
		a=26
		n=n//26-1
	else:
		n=n//26
	s=x[a-1]+s
print(s)

Submission status: Accepted

Solution code:
n = int(input())
ans = ''

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())-1
m=n;i=0;lst=[]
while m>=0:
    i+=1;k=m;m-=26**i
    k
while k>0:
    lst.append(k%26)
    k//=26
for j in range(i-len(lst)):
    lst.append(0)
print(''.join([chr(b+97) for b in lst][::-1]))

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)

S = num2alpha(n)
A = S.lower()
print(A)

Submission status: Accepted

Solution code:
n=int(input())

a="abcdefghijklmnopqrstuvwxyz"
aa=list(a)

stra=""
kk=n
for i in range(15):
    ki=(kk-1)%26+1
    if ki!=0:
        stra=aa[ki-1]+stra    
    else:
        stra=aa[25]+stra    
    kk=(kk-ki)//26
#    print(kk,ki,stra)
    if kk==0:
        break
    
print(stra)

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:
def main():
    import sys
    input = sys.stdin.readline
    from bisect import bisect_left
    N = int(input())
    if N == 1:
        print("a")
        sys.exit()
    d = [chr(i) for i in range(97, 97+26)]
    X = [0, 26]
    y = 26
    while y < 10**15:
        y *= 26
        X.append(X[-1] + y)
    x = bisect_left(X, N) # 桁数
    a = N - X[x-1] - 1
    ans = []
    while a > 0:
        ans.append(a%26)
        a //= 26
    while len(ans) < x:
        ans.append(0)
    for a in reversed(ans):
        print(d[a], end="")
    print()

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = ""
while N:
    N, m = divmod(N, 26)
    if m==0:
        N -= 1
        m += 26
    ans = chr(m+96) + ans
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

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)])
print((alphabet_decimal(n)).lower())

Submission status: Accepted

Solution code:
import math

N = int(input())
al = ['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']

x = N
keta = [0]*100
i = 0
while x > 0:
    if x % 26 == 0:
        keta[i] = 26
    else:
        keta[i] = x % 26
    x -= keta[i]
    x = int(x / 26)
    i += 1

ans = ""
for p in range(i):
    ans = al[keta[p]-1] + ans

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n = int(input())
index = []
while n > 0:
    index.append(n % 26)
    if n % 26 == 0:
        n -= 26
    n //= 26
index.reverse()
ans = ""
for item in index:
    if item == 0:
        ans += "z"
    else:
        ans += chr(ord("a") + item - 1)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
char = [chr(ord('a') + i) for i in range(26)]
res = ''
while N > 0:
    r = N % 26
    res += char[r-1]
    N //= 26
    if r == 0:
        N -= 1
print(res[::-1])

Submission status: Accepted

Solution code:
L=[26**i for i in range(13)]
#print(L)
gun=[sum(L[1:i])for i in range(2,13)]
#print(gun)
N=int(input())
i=0
while N > gun[i]:
  i += 1
#print(i)
if i != 0:
  N = N - gun[i-1] #これを26進法
N -= 1
#print(N)
L=[]
for k in range(1,i+2):
   L.append(N//(26**(i+1-k)))
   N = N % (26**(i+1-k))
#print(L)
L=[chr(i+97) for i in L]
#print(L)
print(''.join(L))

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

Submission status: Accepted

Solution code:
n = int(input())
arfa = ['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']
str = ''
while n > 26:
  amari = n % 26
  n = n // 26 
  if amari == 0:
    n -= 1
  str += arfa[amari-1]
str += arfa[n-1]
print(str[::-1])

Submission status: Accepted

Solution code:
import string
import math
n = int(input())
ans = []
ans1= []
count=1
while n>0:
    ans.append(n%26)
    n-=26
    n=math.ceil(n/26)
ans.reverse()
for i in ans:
    ans1.append(string.ascii_lowercase[i-1])

print("".join(ans1))

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)

N = num2alpha(N)
N_list = list(str(N))

n_arr = []
for str in N_list:
    n_arr.append(str.lower())
    
for i in n_arr:
    print(i, end="")

Submission status: Accepted

Solution code:
import string
N = int(input()) - 1
a = list(string.ascii_lowercase)
ans = ''
tmp = 0
m = 0
while True:
    m, v = divmod(N, 26)
    if m == 0:
        N = m
    else:
        N = m - 1
    ans += a[v]
    if N <= 25:
        break
if m != 0:
    ans += a[N]
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int( input() )
bound = [ 26 ]
add = 26
while bound[ -1 ] < 1000000000000001:
    add *= 26
    bound.append( add + bound[ -1 ] )

d = 0
while bound[ d ] < n:
    d += 1

k = n - bound[ d - 1 ] - 1

alphabet = [chr(i) for i in range(97, 97+26)]
conv = []
for _ in range( d + 1 ):
    conv.append( k % 26 )
    k = k // 26

ans = []
for c in conv:
    ans.append( alphabet[ c ] )

print( "".join( reversed( ans[ : d + 1 ] ) ) )

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = ''
    while 1:
        p,q = divmod(n,26)
        n = p-1 if q==0 else p
        if q==0:
            ans = 'z'+ans
        else:
            ans = chr(ord('a')-1+q)+ans
        if n==0:
            break
    print(ans)

main()

Submission status: Accepted

Solution code:
N = int(input())

DIV = 26

mojiretsu = ''

NUM = 97

i = 1

minus = 0

while(True):
    minus += DIV ** (i - 1)
    mod = (N - minus) % (DIV ** i)
    new_sho = mod // DIV ** (i - 1)
    mojiretsu = chr(NUM + new_sho) + mojiretsu
    sho = (N - minus) // (DIV ** i)
    if sho == 0:
        print(mojiretsu)
        break
    i += 1

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
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(10):
    n_judge = (n-1)//(26**(i+1))
    if n_judge >= 1:
        cnt += 1
        n -= 26**(i+1)
    else:
        break

for j in range(cnt+1):
    n_ = (n-1)//26**(cnt-j)
    ans.append(alphabet[n_])
    n %= 26**(cnt-j)

ans = "".join(ans)
print(ans)

Submission status: Accepted

Solution code:
al=["z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"]
n=int(input())
ans=[]
while n>=1:
    n1=n//26
    a=n%26
    if a==0:
        ans.append("z")
        n=n1-1
        
    else:
        ans.append(al[a])
        n=n1

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

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)

from decimal import *
N=(input())
d=Decimal(N)
aaa="0abcdefghijklmnopqrstuvwxyz"
# 1 000 000 000 000 001

print(num2alpha(d).lower())

Submission status: Accepted

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

# 数値→アルファベット
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:
import math
i=int(input())
alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans=""
a=0
b=0
for k in range (100):
    a+=math.pow(26,k+1)
    if i<=a:
        co=k+1
        break
    b+=math.pow(26,k+1)

i=i-b-1
for k in range(co):
    j=int(i%26)
    ans=alphabet[j]+ans
    i=i//26

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

Submission status: Accepted

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

def can_devide(num):
    return num > 26

def get_alpha(alp):
    apls = [chr(i) for i in range(97, 97+26)]
    return apls[alp - 1]


ans = ""

while True:
    alp = N % 26

    ans += get_alpha(alp)
    
    if alp == 0:
        N = N // 26 -1
    else:
        N = N // 26 
        
    if N == 0:
        break



print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

#print(chr((N%26)+96))
str = []

while N > 0:
    if N%26 == 0 :
        str.append("z")
        N//=26
        N -=1
    else:
        str.append(chr((N%26)+96))
        N //= 26
    # print(N)

#print(str)

for i in reversed(range(len(str))):
    print(str[i],end="")

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)

print(ans.lower())

Submission status: Accepted

Solution code:
import sys
import math
n = int(input())
al = ["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(al))
    surplus = v % len(al)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(al) if surplus == 0 else surplus
    result.append(surplus)
    if len(al) < quotient:
        alphabet_decimal(quotient)
    elif len(al) < v:
        result.append(quotient)
    return "".join([al[i - 1] for i in reversed(result)])

print(alphabet_decimal(int(n)))

Submission status: Accepted

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

for i in range(12):
    n = n - 1
    ret = n%26 #0~25
    string = chr(ret+97) + string
    if n<26:
        break
    n = int((n - ret) / 26)
print(string)

Submission status: Accepted

Solution code:
def oh(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return oh(num//26-1)+chr(90)
    else:
        return oh(num//26)+chr(64+num%26)
print(oh(int(input())).lower())

Submission status: Accepted

Solution code:
n=int(input())
hoge=[-1 for i in range(15)]
alf="abcdefghijklmnopqrstuvwxyz"
for i in range(15):
  if(n==0):
    break
  else:
    n=n-1
    hoge[i]=(n%26)
  n=(n-n%26)//26
hoge=hoge[::-1]

for i in range(len(hoge)):
  if(hoge[i]!=-1):
    print(alf[hoge[i]],end="")

Submission status: Accepted

Solution code:
N = int(input())

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

ans = n2a(N)
print(ans)

Submission status: Accepted

Solution code:
alphabet="abcdefghijklmnopqrstuvwxyz"

N=int(input())

left = N-1

ans = ""
while True:
    idx = left % 26
    left = left // 26 -1 
    ans = alphabet[idx] + ans
    # print(left,idx,ans)

    if left == -1:
        break

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)

print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
n = int(input())

out = ""

from string import ascii_lowercase
from math import ceil
while n:
    out = ascii_lowercase[n % 26 - 1] + out
    
    n = (n - 1) // 26

print(out)

Submission status: Accepted

Solution code:
N=int(input())
seen=[]
ans=""
count=1
while N>0:
    mod=26
    k=(N-1)%mod
    seen.append(k+1)
    N=(N-k-1)//mod

for x in seen[::-1]:
    ans+=chr(96+x)
print(ans)