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:
# coding: utf-8
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))


def main():
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    mod = 26
    n = ni()
    ans = ''
    while n > mod:
        ans += ascii_lowercase[(n%mod)-1]
        if n%mod == 0:
            n = int(n/mod)-1
        else:
            n = int(n/mod)
    ans += ascii_lowercase[(n%mod)-1]
    print(ans[::-1])
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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"]
N = int(input())
ans = ""
i = 0
while N > 0:
    r = N%26
    if r == 0:
        r = 26
    ans = al[r-1] + ans
    N = int((N - r) / 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)
print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
N = int(input())
name = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    name = chr(ord('a') + remainder) + name
print(name)

Submission status: Accepted

Solution code:
n=int(input())
import math
k=math.ceil(math.log(25*n+26,26))-1 # 名前の文字数
n=n-(26**k -26)//25-1
s=""
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"]
for i in range(k):
  s=al[n%26]+s
  n=n//26
print(s)

Submission status: Accepted

Solution code:
#coding:utf-8

N = int(input())

dik = {0:"a",
       1:"b",
       2:"c",
       3:"d",
       4:"e",
       5:"f",
       6:"g",
       7:"h",
       8:"i",
       9:"j",
       10:"k",
       11:"l",
       12:"m",
       13:"n",
       14:"o",
       15:"p",
       16:"q",
       17:"r",
       18:"s",
       19:"t",
       20:"u",
       21:"v",
       22:"w",
       23:"x",
       24:"y",
       25:"z"}

x = 0
ans = ""
n = N

while n > 0:
    n = n - 1
    x = n % 26
    ans += dik[x]
    n = n // 26

ans = ans[::-1]

print(ans)

Submission status: Accepted

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

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

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

n = I()
def base(n, b, digits="abcdefghijklmnopqrstuvwxyz"):
    s = []
    while n>0:
        n -= 1
        s.append( digits[(n%b)] )
        n //= b
    return ''.join(reversed(s))

ans = base(n,26)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

for k in range(20):
    if (26**k-1)//25<=n<(26**(k+1)-1)//25:
        n-=26*(26**(k-1)-1)//25
        break

ans=''
for i in range(k):
        ans+='abcdefghijklmnopqrstuvwxyz'[((n-1)//26**i)%26]

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
A = []
B = []

while N > 26:
    a = N
    N //= 26
    mod = a % 26
    if mod == 0:
        mod = 26
        N -= 1 
    A.append(mod)

A.append(N)
A = A[::-1]

for x in A:
    B.append(alpha[x-1])

ans = ''.join(map(str, B))

print(ans)

Submission status: Accepted

Solution code:
#C
N=int(input())
alpha="zabcdefghijklmnopqrstuvwxy"
cnt=1
while True:
    if N<=26**cnt:
        break
    N-=26**cnt
    cnt+=1
ans=""
for i in range(cnt):
    ans=alpha[N%26]+ans
    N=(N-1)//26+1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
n = N
cnt = 0
while N > 0:
    cnt += 1
    if N > 26:
        N -= 26 ** cnt
    else:
        break

s = 0
for i in range(1,cnt):
    s += 26 ** i
k = n-s-1

A = []
for i in range(cnt):
    A.append(k%26)
    k = k // 26
    
ans = []
for i in A:
    ans.append(chr(i + 97))

print(*ans[::-1], sep = "")

Submission status: Accepted

Solution code:
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import string

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))


def solve():
    return

def main():
    n = get_int()
    terms = 0
    i = 1
    while n>terms:
        terms += 26**i
        i += 1
    # print(i, terms, old_terms)
    i -= 2
    ans = ""
    n  = n-(terms-26**(i+1))-1
    if n==0: ans = "a"*(i+1)
    alphabets = list(string.ascii_lowercase)
    while n>0:
        index,n = divmod(n,26**i)
        i -= 1
        #print(index, i, n,ans)
        ans += alphabets[index]
        if n==0 and i==0: ans += "a"

    print(ans)



TestCases = False

if TestCases:
    for i in range(get_int()):
        main()
else:
    main()

Submission status: Accepted

Solution code:
bounds = [sum([26 ** i for i in range(n)]) for n in range(1, 12)]
lis = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())
for b in reversed(bounds):
    if b <= N:
        break
N -= b 
length = bounds.index(b) + 1
s = ''
for i in range(length - 1, 0, -1):
    idx, N = divmod(N, 26**i)
    s = s + lis[idx]
print(s + lis[N])

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N = INT()
i = 1
while N > 26**i:
	N -= 26**i
	i += 1

ans = ""
N -= 1
for j in range(i-1, -1, -1):
	ans += ascii_lowercase[N//(26**j)]
	N %= 26**j

print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

if __name__ == "__main__":
    n = int(input())
    a = [0]*18
    a[0] = 26
    b = 2
    alpa = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
    for i in range(1,18):
        a[i] = a[i-1] + 26**b
        b+=1
    d = bisect.bisect_left(a,n)
    ans = "a"*(d+1)
    n = n - a[d-1] -1
    ans = ""
    for i in range(d,-1,-1):
        if i == d:
            ans += alpa[n%(26)]
        else:
            ans += alpa[n%(26)]
        n = n//26
    ans2 = ""
    for i in range(len(ans)):
        ans2 += ans[len(ans)-i-1]
    print(ans2)

Submission status: Accepted

Solution code:
n=int(input())  #96
a=""
while n>0:
    n-=1
    rem=n%26
    a+=chr(97+rem)
    n=(n-rem)//26
    
print(a[::-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)
      
r = num2alpha(n)
ru = r.lower()
print(ru)

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

Submission status: Accepted

Solution code:
N = int(input())
alpha = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    alpha = chr(ord('a') + remainder) + alpha
print(''.join(alpha))

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:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code

def resolve():
    N,=pin()
    ans=[]
    t=0
    
    max_digit=len("1000000000000001")
    ans=[]
    for i in range(max_digit):
        a=(N-1)%26+1
        if a==0:break
        ans.append(a)
        if a==N :
            break
        N=(N-a)//26

    ans.reverse()
#    print(ans)
    A=""
    for a in ans:
        A+=chr(ord("a")-1+a) 
    print(A)   
#%%submit!
resolve()

Submission status: Accepted

Solution code:
n=int(input())
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']
z=[]
while n>26:
  r=n%26
  n=n//26
  if r==0:
    n-=1
  z.append(r)
z.append(n)
s=''
for x in z:
  let=l[x-1]
  s=let+s
print(s)

Submission status: Accepted

Solution code:
a=int(input())
b=[]
while a>26:
    c=a%26
    b.append(c)
    a=(a-1)//26

ans=""
b.append(a)
b=b[::-1]
for i in b:
    if i==0:
        ans+="z"
    else:
        ans+=chr(i+96)

print(ans)

Submission status: Accepted

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

while n >= 1 / 26:
    div = n % 26
    if div == 0:
        div = 26
    name = chr(div + 64) + name
    n = math.floor((n - div) / 26)
print(name.lower())

Submission status: Accepted

Solution code:
AL="abcdefghijklmnopqrstuvwxyz"
keta=[0,26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286, 99246114928149462, 2580398988131886038]
kata=[1, 26, 676, 17576, 456976, 11881376, 308915776, 8031810176, 208827064576, 5429503678976, 141167095653376, 3670344486987776, 95428956661682176]
n=int(input())
for i in range(12):
    if(n<=keta[i]):
        s=i
        sn=n-keta[s-1]
        break

def check(n,zn):
    tani = kata[zn]
    for i in range(1,27):
        if(tani*i>=n):
            moji=AL[i-1]
            n-=tani*(i-1)
            break
    return (n,moji)

for i in range(s-1,-1,-1):
    (sn,a)=check(sn,i)
    print(a,end="")

Submission status: Accepted

Solution code:
N = int(input())
name = ''
while N > 0:
    N, remainder = divmod(N - 1, 26)
    name = chr(ord('a') + remainder) + name
print(''.join(name))

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())
l = []
while n != 0:
	a = n % 26
	l.append(a)
	n = n // 26
s = ""
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"]
for i in range(len(l)):
	if l[i] == 0:
		if i != len(l)-1:	
			for j in range(i+1, len(l)):
				if l[j] != 0:
					for k in range(i+1, j):
						l[k] = 25
					l[j] -= 1
					s = "z" + s
					break
	else:
		s = c[l[i]] + s
print(s)

Submission status: Accepted

Solution code:
N = int(input())

S = 'abcdefghijklmnopqrstuvwxyz'

def bite(X):
    s = 0
    t = 0
    while t < X:
        t = t + 26**(s+1)
        s = s + 1
    return s


B = bite(N)
X = N
L = []
for i in range(B):
    if X%26 != 0:
        L.append(X%26)
        X = (X-X%26)//26
    else:
        L.append(26)
        X = (X - 26)//26

L.reverse()

ans = ''
for i in range(B):
    ans = ans + S[L[i]-1]

    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
ans = ''
while N != 0:
    y = N%26
    if y == 0:
        ans = a[-1] + ans
        N = N//26 - 1
    else:
        ans = a[y-1] + ans
        N = N//26 
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
c = 1
tmp = 26
while tmp < n:
    tmp += 26**(c + 1)
    c += 1
ans = ''
for i in range(c):
    a = n % 26
    if a == 0:
        a = 26
    ans = chr(a + 96) + ans
    n = (n - a) // 26
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
#, setrecursionlimit, stdout
#setrecursionlimit(1000000)
#from collections import deque
#from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def si(): return stdin.readline().rstrip()
def lsi(): return list(si())
#mod=1000000007
res=['Yes', 'No']
############# CODE STARTS HERE #############


test_case=1
while test_case:
    test_case-=1



    n=ii()
    a=[]
    z=26
    while n:
        x=n%26
        n//=z
        if not x:
            p='z'
            n-=1
        else:
            p=chr(96+x)
        a.append(p)
    print(*a[::-1], sep='')

Submission status: Accepted

Solution code:
n=int(input())
ei="$abcdefghijklmnopqrstuvwxyz"
fla=[]
flaa=[0]
ans=""
cnt=2

for i in range(1,20):
    fla.append(26**i)
    flaa.append(flaa[i-1]+26**i)
for i in range(20):
    if n<=flaa[i]:
        k=i
        break
# print(flaa,k)
if k==1:
    print(ei[n])
    exit()

b=n-flaa[k-1]
# print(b)
while len(ans)!=k-1:
    for i in range(1,27):
        if fla[k-cnt]*i>=b:
            ans+=str(ei[i])
            b-=fla[k-cnt]*(i-1)
            cnt+=1
            # print(b)
            break
ans+=str(ei[b])

print(ans)

Submission status: Accepted

Solution code:
entierAConvertir = int(input())
baseArrivee= 26 
sortie = []
while entierAConvertir>0:
  reste = entierAConvertir % baseArrivee
  if reste==0:
    reste = 26
  sortie.append(reste)
  entierAConvertir-=reste
  entierAConvertir = (entierAConvertir//baseArrivee)
for i in range(len(sortie)):
  print(chr(sortie[len(sortie)-1-i]+ord('a')-1),end="")

Submission status: Accepted

Solution code:
import sys
n=int(input())
alphabet="abcdefghijklmnopqrstuvwxyz"
l=[]
a=1
sm=0
for i in range(15):
    a*=26
    sm+=a
    l.append(sm)

for i in range(len(l)):
    if n<=l[i]:
        cl=i
        break

if cl==0:
    print(alphabet[n-1])
    sys.exit()
ans=""
n-=l[cl-1]

#最後の１文字以外を決める
for i in range(cl):
    num=(n-1)//(26**(cl-i))
    ans=ans+alphabet[num]
    n-=(26**(cl-i))*num

if n!=0:
    ans=ans+alphabet[n-1]
else:
    ans=ans+"z"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

x = []
for i in range(1, 11):
    x.append(26 ** i)

count = 1

for i in x:
    if n > i:
        n = n - i
        count += 1

def base26(value): # 10 => 2
    x = 26
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    result = []
    tmp = int(value)
    while tmp >= x:
        result.append(str(tmp%x))
        tmp = int(tmp / x)
    result.append(str(tmp%x))
    return result

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

ans = base26(n-1)
ans2 = ['a'] * count

for i in range(len(ans)):
    ans2[i] = alp[int(ans[i])]

ans2 = list(reversed(ans2))

print(''.join(ans2))

Submission status: Accepted

Solution code:
N = int(input())
M = 26
tmp = N
out = ''
while tmp > 0:
    res = tmp % M
    if res == 0:
        c = "z"
        tmp -= 26
    else:
        c = chr(ord('a') + tmp % M - 1)
    out = str(c) + out
    tmp = int(tmp/M)
print(out)

Submission status: Accepted

Solution code:
n=int(input())
t=1
a=[]
x=[]
while True:
    if n<=(26**t-1)*26//25:
        break
    t+=1


n=n-(26**(t-1)-1)*26//25-1
for i in range(t-1,0,-1):
    a.append(n//(26**i))
    n=n%(26**i)
a.append(n)

for i in range(len(a)):
    x.append(chr(a[i]+97))
print("".join(x))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
al = 26
i = 1
while N > al**i:
    N -= al**(i)
    i += 1
ans = ''
a = ord('a')
while i > 0:
    ans += chr(a + (N-1) // al**(i-1))
    N = (N-1) % al**(i-1) + 1
    i -= 1
print(ans)

Submission status: Accepted

Solution code:
a=[26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286]
n=int(input())
k=0
for i in range(10):
    if n<=a[i]:
        k=i+1
        break
else:
    k=11
if k==1:
    print(chr(n+96))
else:
    ans=""
    n=n-a[k-2]-1
    for i in range(k):
        if i!=k-1:
            ans+=chr(n//(26**(k-1-i))+97)
            n=n%(26**(k-1-i))
        else:
            ans+=chr(n%26+97)
    print(ans)

Submission status: Accepted

Solution code:
N=int(input())
a=N//27
b=N%27
s=''
if N<27:
  print(chr(N+96))
else:
  n=N
  j=0
  for i in range(1,11):
    if n-1-pow(26,i)>=0:
      n-=pow(26,i)
      j=i
    else:
      break
  for k in range(j,-1,-1):
    if k==0:
      s=s+chr(n-1+97)
    else:
      s=s+chr((n-1)//pow(26,k)+97)
      n-=((n-1)//pow(26,k))*pow(26,k)
  print(s)

Submission status: Accepted

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

name = ''
next_N = N
for i in range(11):
    m = next_N % 26
    next_N //= 26

    if m > 0:
        name = chr(0x60 + m) + name
    elif m == 0:
        name = 'z' + name
        next_N -= 1

    if next_N <= 0:
        break

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)

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

Submission status: Accepted

Solution code:
import itertools as it
import bisect
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())-1
x=[0]+[26**i for i in range(1,20)]
y=list(it.accumulate(x))
keta=bisect.bisect_left(y,n)
#print(y)
number=n-y[keta-1]
#print(number)
#print(keta)
ll=[]
for i in range(keta):
  u=number//(26)**(keta-i-1)
  ll.append(u+1)
  #print(ll)
  number-=u*((26)**(keta-i-1))
ans=list(num2alpha(i).lower() for i in ll)
#print(ll)
if n!=0:
   print(*ans,sep="")  
else:
  print("a")

Submission status: Accepted

Solution code:

import sys
n=int(input())
p=n
a=[]
cnt=0

if n<=26:
    print(chr(n+96))
    sys.exit()
while p>0:
    p=p//26
    cnt+=1


#print(n)
for i in range(cnt-1):
    q,r=divmod(n,26**(cnt-i-1))
    a.append(q)
    n=r
if n<=25:
    a.append(n)
    
    
#print(cnt,a)
for i in range(len(a)-1,0,-1):
    if a[i]<=0:
        a[i]+=26
        a[i-1]-=1
#print(a)

flag=True
j=0
while flag:
    if a[j]==0:
        j+=1
    else:
        flag=False
a=a[j:]
        
eigo=[chr(i) for i in range(97,123)]    
for i in a:
    print(eigo[i-1],end="")

Submission status: Accepted

Solution code:
n = int(input())
nam = ""
flag = True
while(flag):
    k = n % 26
    if n <= 26: flag = False
    if k == 0: k = 26
    nam = chr(96 + k) + nam
    n = (n - k) // 26
print(nam)

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

print(num2alpha(N).lower())

Submission status: Accepted

Solution code:
#c
n = int(input())
alpha = [chr(i) for i in range(97, 97+26)]
i = 0
s = 0
while True:
    i  += 1
    if (n-1) //(26**i+s) < 1: #これが文字数
        break
    s = s + 26**i #累積和
t_turn = n-s #これが文字数内の順番
ans =""
for j in range(i,0,-1):
    ans += alpha[((t_turn-1)//(26**(j-1)))]
    t_turn = t_turn-((t_turn-1)//(26**(j-1)))*(26**(j-1))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())


def n2a(n):
    if n == 0:
        return "z"
    n += 96
    return chr(n)


res = ""

while N > 0:
    t = N % 26
    res = n2a(t) + res
    N //= 26
    if t == 0:
        N -= 1

print(res)

Submission status: Accepted

Solution code:
N = int(input())

N -= 1
a = list()
alpha = [i for i in 'abcdefghijklmnopqrstuvwxyz']
if N < 26:
    a.append(alpha[N])
else:
    while N > 0:
        sho = N // 26
        amari = N % 26
        a.append(alpha[amari])
        N = N // 26 - 1
    if N == 0:
        a.append(alpha[N])
a.reverse()
print(''.join(a))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
import string

def decimal_to_26(N):
    number_list = []
    while True:
        number_list.append(N%26)
        N = N//26
        if N == 0:
            if number_list[-1] == 0:
                number_list.pop(-1)
            break
    number_list = number_list[::-1]
    N_26_str = "".join(
        [string.ascii_lowercase[i] for i in number_list]
    )
    return N_26_str

def main():
    N = int(input())
    N -= 1

    counter = 1
    while N >= pow(26, counter):
        N -= pow(26, counter)
        counter += 1
    
    N_26_str = decimal_to_26(N)
    answer = "a"*(counter-len(N_26_str))+N_26_str
    print(answer)

if __name__ == "__main__":
    #print(decimal_to_26(26))
    main()

Submission status: Accepted

Solution code:
n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
result = ''
ans = 0

while n > 0:
    if n % 26 == 0:
        ans = 25
    else:
        ans = n % 26 - 1
    result = alphabet[ans] + result
    n = (n-ans) // 26

print(result)

Submission status: Accepted

Solution code:
def convert(a,b):
    if (int(a/b)):
        return convert(int(a/b), b)+str(a%b)
    return str(a%b)

def main():
    N=int(input())
    m=0
    ans=[]
    l=['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']
    while True:
        m=N%26
        ans.append(l[m])
        if m==0: N-=26
        else: N-=m
        N=N//26
        if N==0: break
    ans.reverse()
    print(''.join(ans))
    return

if __name__=='__main__':
    main()

Submission status: Accepted

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

while True:
    if n- 26 **i <= 0:
        break
    n -= 26 ** i
    i += 1
    
n -= 1

for j in range(i):
    ans = str_list[n%26] + ans
    n //= 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())

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

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())
S = ""
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"]
while N>26:
    N-=1
    S=Alpha[N%26]+S
    N=N//26
N-=1
S=Alpha[N%26]+S
print(S)

Submission status: Accepted

Solution code:
def base(n, b):
    d="abcdefghijklmnopqrstuvwxyz"
    s = []
    while True:
        s.append(d[n % b])
        n = n//b -1
        if n < 0:
          break
    return ''.join(reversed(s))
print(base(int(input())-1,26))

Submission status: Accepted

Solution code:
import string

def main():
  N = int(input())
  az = string.ascii_lowercase
  d = 26
  ans = ""

  while(N > 0):
    m = (N-1) % d
    ans = az[m] + ans
    N = (N-1) // d
    
  print(ans)


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
n = int(input())

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

revarr = arr[::-1]
ans = ""
# print(arr)
#print(revarr)
for i in revarr:
    ans += dicts[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = ['z']
for i in range(25):
    a.append(chr(0x61 + i))
l = []
for i in range(20):
    x = N % 26
    l.append(a[x])
    N = N // 26
    if x == 0:
        N -= 1
    if N == 0:
        break

print("".join(reversed(l)))

Submission status: Accepted

Solution code:
n=int(input())
s=''
i=0
a=[]
while n>0:
    t=n%26

    if t==0:
        s+='z'
        n=n//26-1
    else:
        s+=chr(t-1+ord('a'))
        n=n//26
print(s[::-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)
      
ans = num2alpha(n)
print(ans.lower())

Submission status: Accepted

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

while True:
  n -= 1
  x = divmod(n,26)
  ans = ans + chr(ord('a')+x[1])
  
  n = n - x[1]
  n = n // 26
  if n == 0:
    break
    
ans = ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

#26の倍数の辞書を保持する

a = 1
baisu = []
ruiseki = [26]

for i in range(11):
    a *= 26
    baisu.append(a)
    if i != 0:
        ruiseki.append(ruiseki[i-1]+a)

#何桁か  
length = 0
new_N = 0
f = True
for i,rui in enumerate(ruiseki):
    if N <= rui:
        length = i+1
        if i!=0:
            new_N = N-ruiseki[i-1]
        else:
            new_N = N
        f = False
        break
if f:
    new_N = N-ruiseki[-1]

# print(length)



# print(new_N)
# print(length)
# print(baisu)

ans = []
for i in range(length):
    u = 0
    cnt = 0
    while(1):
        if new_N <= 26 and i==length-1:
            ans.append(new_N-1)

            break
        pre_u = u
        u += baisu[length - i -2 ]
        if new_N <= u:
            ans.append(cnt)
            new_N -= pre_u
            break
        cnt += 1

alp = [chr(ord('a') + i) for i in range(26)]
ans_c = ""

# print(ans)
for an in ans:
    ans_c+=alp[an]
print(ans_c)




# while(1):
#     for bai in baisu:


# print(baisu)
# print(ruiseki)

Submission status: Accepted

Solution code:
n=int(input())
num=26
data=[]
while num<=n:
    if n%num==0:
        data.append("z")
        n=int(n/num-1)
    else:
        data.append(chr(n%26+96))
        n=int(n/num)
if n!=0:
    data.append(chr(n+96))
data="".join(data)
print(data[::-1])

Submission status: Accepted

Solution code:
n = int(input())
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 = ''
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = a[X_dumy%n-1]+out
        if a[X_dumy%n-1] == 'z':
          X_dumy -= 26
        X_dumy = X_dumy//n
    return out

z = Base_10_to_n(n, 26)
print(z)