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:
def nod(n) :
    i = 1
    while n > 26 ** i :
        n = n - 26 ** i
        i += 1
    return i
 
n = int(input())
i = nod(n)
##print(i)
demo = [26 ** j for j in range(12)]
demo1 = []
k = 0
for j in demo :
    k += j
    demo1.append(k)
##print(demo)
##print(demo1)
n = n - demo1[i - 1] + 1
##print(n)
##print(n / 26)
if n / 26 != n // 26 :
    i -= 1
    ans = []
    while i >= 0 :
        k = n // (26 ** i)
        n -= (26 ** i) * k
        if i > 0 :
            ans.append(chr(96 + k + 1))
        else :
            ans.append(chr(96 + k))
        i -= 1
    print(''.join(map(str,ans)))
else :
    i -= 1
    ans = []
    while i >= 0 :
        k = n // (26 ** i)
        n -= (26 ** i)*k
        if n > 0 :
            if i > 1 :
    ##            print(k,chr(96+k+1))
                ans.append(chr(96+k+1))
            elif i == 1 :
    ##            print(k,chr(96+k))
                ans.append(chr(96 + k))
            else :
                ans.append('z')
        else :
                ans.append(chr(96 + k))
                
                while i > 0 :
                    ans.append('z')
                    i -= 1
                break
        i -= 1
    print(''.join(map(str,ans)))

Submission status: Accepted

Solution code:
n = int(input())

ans = []
while n > 0:
    n -= 1 # これが必要
    ans.append(chr(ord('a') + n % 26))
    n //= 26

print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
L=list()
def Base_10_to_n(X, n):
  X_dumy = X
  out = ''
  while X_dumy>0:
    L.append(str(X_dumy%n))
    X_dumy = int(X_dumy/n)
  return(L)
N=int(input())
L=Base_10_to_n(N, 26)
L=list(map(int,L))
for i in range(len(L)-1):
  if L[i]<=0:
    L[i]+=26
    L[i+1]=L[i+1]-1
if L[-1]==0:
  L.pop()
L=reversed(L)
R=["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"]
P=[R[i-1] for i in L]
print("".join(P))

Submission status: Accepted

Solution code:
n = int(input())

ans = []
for i in range(1, 99): # 99は適当
    if n <= 26**i:
        n -= 1 # これが必要
        for j in range(i):
            ans.append(chr(ord('a') + n % 26))
            n //= 26
        break
    else:
        n -= 26**i

print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
N = int(input())

s = 1
while N > 26 ** s:
    N -= 26 ** s
    s += 1

ans = ""
N -= 1
for i in range(s)[::-1]:
    a = N // (26 ** i)
    N -= (26 ** i) * a
    ans += chr(ord("a") + a)
    
print(ans)

Submission status: Accepted

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

for i in range(1, 99):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a') + n % 26)
            n //= 26
        break
    else:
        n -= 26 ** i

print(ans[::-1])

Submission status: Accepted

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

while n!=0:
  n-=1
  ans+=check[n%26]
  n//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
N=int(input())
name=""
while N>0:
    N-=1
    name+=chr(ord("a")+N%26)
    N//=26
print(name[::-1])

Submission status: Accepted

Solution code:
def INPUT():return list(int(i) for i in input().split())
#====================
n=int(input())
ans=""
for i in range(1,14):
    if n<=26**i:
        n-=1
        for j in range(i):
            ans+=chr(ord('a')+n%26)
            n//=26
        break
    else:
        n-=26**i
print(ans[::-1])

Submission status: Accepted

Solution code:
N=int(input())
name=""
while N>0:
    N-=1
    name=chr(ord("a")+N%26)+name
    N//=26
print(name)

Submission status: Accepted

Solution code:
n = int(input())
 
ans = []
for i in range(1, 99): # 99は適当
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans.append(chr(ord('a') + n % 26))
            n //= 26
        break
    else:
        n -= 26**i
 
print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
# 解説youtubeを見て実装

n = int(input())

def f(n):
  if n == 0:
    return ''
  n -= 1
  return f(n//26) + chr(ord('a') + (n%26))

print(f(n))

Submission status: Accepted

Solution code:
n = int(input())

ans = []
for i in range(1, 99): # 99は適当
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans.append(chr(ord('a') + n % 26))
            n //= 26
        break
    else:
        n -= 26**i

print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
n = int(input())
s = ""
while n > 0:
  n -= 1
  s = chr(ord('a') + (n%26)) + s
  n //= 26
print(s)

Submission status: Accepted

Solution code:
n = int(input())

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

print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
from string import ascii_lowercase as l
n=int(input())
j=1
answer=""
while n>26**j:
  n-=26**j
  j+=1
n-=1
for i in range(j):
  answer=l[n%26]+answer
  n//=26
print(answer)

Submission status: Accepted

Solution code:
from math import floor, log
def solve():
    N = int(input()) - 1
    
    ans = []

    while N >= 26:
        ans.append(chr(N % 26 + ord('a')))
        N //= 26
        N -= 1
    else:
        ans.append(chr(N % 26 + ord('a')))

    print("".join(ans[::-1]))
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

N = int(input())

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

ans = []

for i in range(11):
    N -= 1
    if N < 0:
        break
    ans.append(alpha[N % 26])
    N //= 26

print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
name = ''
count = 0

while n > 0:
    n -= 1
    mod = n % 26
    name += chr(97 + mod)
    n = n // 26


print(name[::-1])

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True

ret = []

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n) + ',' +str(X%n)
    return str(X%n)

def main():
    N = I()
    N -= 1

    for i in range(1, 15):
        if N >= 26 ** i:
            N -= 26 ** i
            continue

        ans = ''
        for j in range(i):
            r = N % 26
            N //= 26
            ans += l_alp[r]

        print(ans[::-1])
        break


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):
    ans = []
    while N > 0:
        N -= 1
        c = N % 26
        ans.append(chr(ord('a')+c))
        N //= 26
    return ''.join(reversed(ans))


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
###
n=int(input())
ans=[]
while n:
    n-=1####
    ans.append(chr(ord('a')+n%26))
    n//=26
ans=ans[::-1]
print(''.join(ans))

Submission status: Accepted

Solution code:
n=int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"

n_rem = n
ans = ""

while True:
    x = n_rem%26
    if x == 0:
        x = 26
    ans += chars[x]

    n_rem -= x

    if n_rem == 0:
        break

    n_rem //=26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
name = ""
 
while(True):
  i = n % 26
  c = "zabcdefghijklmnopqrstuvwxyz"[i]
  name = c + name
  
  if(i==0):
    i=26
  n = int((n-i) / 26)
  if(n==0):
    break
    
print(name)

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
input=lambda: sys.stdin.readline().rstrip()

class Tree:
    def __init__(self,inp_size=None,ls=None,init=True,index=1):
        self.LCA_init_stat=False
        self.ETtable=[]
        if init:
            if ls==None:
                self.stdin(inp_size,index=index)
            else:
                self.node_size=len(ls)+1
                self.edges,_=GI(self.node_size,self.node_size-1,ls,index=index)
        return
 
    def stdin(self,inp_size=None,index=1):
        if inp_size==None:
            self.node_size=int(input())
        else:
            self.node_size=inp_size
        self.edges,_=GI(self.node_size,self.node_size-1,index=index)
        return
    
    def listin(self,ls,index=0):
        self.node_size=len(ls)+1
        self.edges,_=GI(self.node_size,self.node_size-1,ls,index=index)
        return
 
    def dfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.node_size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def bfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.node_size
        v[x]=root_v
        while q:
            c=q.popleft()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def parent(self,x):
        return self.dfs(0,func=lambda pr,prv,nx,dist:pr,root_v=-1)
 
    def topological_sort(self,x):  # return topological sort of the tree
        tps=[]
        q=deque([x])
        v=[None]*self.node_size
        v[x]=0
        while q:
            c=q.popleft()
            tps.append(c)
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=0
        return tps
 
    def EulerTour(self,x):
        q=deque()
        q.append(x)
        self.depth=[None]*self.node_size
        self.depth[x]=0
        self.ETtable=[]
        self.ETdepth=[]
        self.ETin=[-1]*self.node_size
        self.ETout=[-1]*self.node_size
        cnt=0
        while q:
            c=q.pop()
            if c<0:
                ce=~c
            else:
                ce=c
                for nb,d in self.edges[ce]:
                    if self.depth[nb]==None:
                        q.append(~ce)
                        q.append(nb)
                        self.depth[nb]=self.depth[ce]+1
            self.ETtable.append(ce)
            self.ETdepth.append(self.depth[ce])
            if self.ETin[ce]==-1:
                self.ETin[ce]=cnt
            else:
                self.ETout[ce]=cnt
            cnt+=1
        return
    
    def LCA_init(self,root):
        self.EulerTour(root)
        self.st=SparseTable(self.ETdepth,init_func=min,init_idl=inf)
        #self.st=SegTree(self.node_size*2-1,self.ETdepth,function=min,ide=inf)
        self.LCA_init_stat=True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            self.LCA_init(root)
        xin,xout=self.ETin[x],self.ETout[x]
        yin,yout=self.ETin[y],self.ETout[y]
        a=min(xin,yin)
        b=max(xout,yout,xin,yin)
        id_of_min_dep_in_et=self.st.query_id(a,b+1)
        return self.ETtable[id_of_min_dep_in_et]
 
    def __str__(self):
        return  str(self.edges)
 
    def show(self):
        if all([all([d==1 for nd,d in e]) for e in self.edges]):
            print( [[nd for nd,d in e] for e in self.edges] )
        else:
            print(self)

class SparseTable: # O(N log N) for init, O(1) for query(l,r)
    def __init__(self,ls,init_func=min,init_idl=float('inf')):
        self.func=init_func
        self.idl=init_idl
        self.size=len(ls)
        self.N0=self.size.bit_length()
        self.table=[ls[:]]
        self.index=[list(range(self.size))]
        self.lg=[0]*(self.size+1)
        
        for i in range(2,self.size+1):
            self.lg[i]=self.lg[i>>1]+1
 
        for i in range(self.N0):
            tmp=[self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) for j in range(self.size)]
            tmp_id=[self.index[i][j] if self.table[i][j]==self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) else self.index[i][min(j+(1<<i),self.size-1)] for j in range(self.size)]
            self.table+=[tmp]
            self.index+=[tmp_id]
    
    # return func of [l,r)
    def query(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        return self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))])
    
    # return index of which val[i] = func of v among [l,r)
    def query_id(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        a,b=self.index[N][l],self.index[N][max(0,r-(1<<N))]
        if self.table[0][a]==self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))]):
            b=a
        return b
    
    # return boundary index of r such that func({table[i]} =< x , i in [pos,r]
    def right_bound(self,pos,x):
        k=(self.size-pos).bit_length()
        for j in range(k)[::-1]:
            nx=pos+(1<<j)
            if nx<n and self.query(pos,nx+1)<=x:
                pos+=(1<<j)
        return pos
    
    # return boundary index of l such that func({table[i]} =< x , i in [l,pos]
    def left_bound(self,pos,x):
        k=pos.bit_length()
        for j in range(k)[::-1]:
            nx=pos-(1<<j)
            if 0<=nx and self.query(nx,pos+1)<=x:
                pos-=(1<<j)
        return pos
 
    def __str__(self):
        return str(self.table[0])
 
    def print(self):
        for i in self.table:
            print(*i)


show_flg=False
show_flg=True


ans=0

n=I()

def solve(n):
    ans=[]
    while n>0:
        t=(n-1)%26
        n-=t
        n//=26
        ans+=[t]
    return LtoS(ans[::-1])

print(solve(n))

Submission status: Accepted

Solution code:
def main():#やり直し
    #input
    N=int(input())
    l=list("abcdefghijklmnopqrstuvwxyz")
    n=N
    name=""
    while n>=26:
        n-=1
        name+=l[n%26]
        n//=26
    if n!=0:
        name+=l[n-1]
    print(name[::-1])

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = 'abcdefghijklmnopqrstuvwxyz'
    ans = []
    while n:
        ans.append(a[(n-1) % 26])
        if (n-1) % 26 == 25:
            n -= 1
        n //= 26
    print("".join(reversed(ans)))


main()

Submission status: Accepted

Solution code:
import string

N = int(input())
name_l = list(string.ascii_lowercase)

name_N = ''
div_N = N

while True:
    i = div_N%26
    if i == 0:
        i = 26
    name_N = name_l[i-1] + name_N
    if div_N <= 26:
        break
    div_N //= 26
    if i == 26:
        div_N -= 1

print(name_N)

Submission status: Accepted

Solution code:
alphabet = "abcdefghijklmnopqrstuvwxyz"

N = int(input())

ans = ""
while N > 0:
    r = (N-1) % 26
    ans += alphabet[r]
    N = (N-r) // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
ans = ''
while(N):
    N -= 1
    ans+=chr(ord('a')+N % 26)
    N //= 26
print (ans[::-1])

Submission status: Accepted

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

now = 0
for i in range(1,20):
    now += 26**i
    if now >= N:
        keta = i
        break
    
for i in range(keta):
    if i != 0:
        N -= 26**(i)

N = N-1
answer_list = []
for i in range(keta-1):
    answer_list.append(N//26**(keta-(i+1)))
    N = N%26**(keta-(i+1))
    
answer_list.append(N)

for i in range(len(answer_list)):
    answer_list[i] = chr(answer_list[i]+97)
print("".join(str(n) for n in answer_list))

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
while N != 0:
    N -= 1
    ans += chr(ord('a') + N % 26)

    N //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
alp = lambda x: chr(x + ord('a') - 1) if x != 0 else 'z'
x = 0
while n != 0:
    rem = (n % (26 ** (x + 1))) // (26 ** x)
    ans = alp(rem) + ans
    n -= rem * 26 ** x if rem != 0 else 26 ** (x + 1)
    x += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=[]
while n>26:
	tmp=n%26
	if tmp==0:
		tmp=26
		n-=1
	ans.append(tmp)
	n=n//26
ans.append(n)
ans=ans[::-1]
for a in ans:
	print(chr(a+96),end="")

Submission status: Accepted

Solution code:
def get_name(n, alphabet):
  if n // len(alphabet):
    return get_name(n // len(alphabet), alphabet) + alphabet[n % len(alphabet)]
  return alphabet[n % len(alphabet)]

N = int(input())
i = 0
alphabet = 'abcdefghijklmnopqrstuvwxyz'
while True:
  N -= len(alphabet) ** i
  if N < len(alphabet) ** (i + 1):
    name = get_name(N, alphabet)
    for j in range(i + 1 - len(name)):
      name = alphabet[0] + name
    break
  else:
    i += 1
    
print(name)

Submission status: Accepted

Solution code:
n = int(input())
abc = ['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']
res = []
ans = ''
while n:
    res.append((n-1)%26)
    n = (n-1)//26

#print(res[::-1])


for i in range(len(res)):
    ans += abc[res[i]]

print(ans[::-1])

Submission status: Accepted

Solution code:
import string

N = int(input())

g = 1
while N > 26**g:
    N -= 26**g
    g += 1

N -= 1
ans = ""
for i in range(g):
    c = N % 26
    ans = string.ascii_lowercase[c] + ans
    N = N // 26

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
m = ord('a') - 1
x = 0
while n != 0:
    rem = (n % (26 ** (x + 1))) // (26 ** x)
    if rem == 0:
        ans = 'z' + ans
        n -= 26 ** (x + 1)
    else:
        ans = chr(m + rem) + ans
        n -= rem * 26 ** x
    x += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

s,c=[],1
while N>0:
  if N>26**c:
    N-=26**c
    c+=1
  else:
    N-=1
    while c>0:
      s.append(chr(0x61+N%26))
      N//=26
      c-=1

print(''.join(s[::-1]))

Submission status: Accepted

Solution code:
import sys
import math
# sys.stdin=open('input.txt','r')
# sys.stdout=open('output.txt','w')
from sys import stdin,stdout
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007
s='abcdefghijklmnopqrstuvwxyz'
n=ii1()
res=''
for i in range(1,100):
    if n<=26**i:
        n-=1
        for j in range(i):
            res+=chr(97+n%26)
            n//=26
        break
    else:
        n-=26**i
print(res[::-1])

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"]
answer = []
while n >= 1:
    n -= 1
    answer.append(l[n % 26])
    n = n//26
ans = ''.join(list(reversed(answer)))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""

while True:
    x = n_rem % 26
    # 余りが0、つまりzの場合は、26にします
    if x == 0:
        x = 26
    res += chars[x]

    # xを引いて、26で割ります
    n_rem -= x

    # 0なら終了します
    if n_rem == 0:
        break

    n_rem //= 26

# 0桁目が先頭で、最後の桁が末尾になっているので、反転させます
print(res[::-1])

Submission status: Accepted

Solution code:
n = int(input())

a = []
for i in range(26):
	a.append(chr(i+ord('a')))

ans = ''
while n:
	d = (n-1) % 26 + 1
	ans += a[d-1]
	n = (n-1) // 26

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

Submission status: Accepted

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

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

print(ans[::-1])

Submission status: Accepted

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

while n > 0:
  n -= 1
  ans += chr(n % 26 + 97)
  n //= 26

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

Submission status: Accepted

Solution code:
ans=''
n=int(input())
while n:
    r=n%26
    q=n//26
    if r==0:
        q=q-1
        ans=ans+'z'
    else:
        ans=ans+chr(97+r-1)
    n=q
print(ans[::-1])

Submission status: Accepted

Solution code:
# @oj: atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-06-22 17:09
# @url:https://atcoder.jp/contests/abc171/tasks/abc171_c
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
from decimal import *
# region fastio

BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

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

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

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

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


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


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# ------------------------------
def main():
    n=int(input())
    ans=""
    while n>=1:
        m=n%26
        if m>0:
            ans+=(chr(ord('a')+m-1))
            n=n//26
        else:
            ans+="z"
            n=n//26-1
    print (ans[::-1])
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
keta = 1
end = 0
while True:
    order = n - end
    end += 26**keta
    if n <= end:
        break
    keta += 1
order -= 1
ans = []
for i in range(keta):
    ans.append(chr(order%26 + 97))
    order //= 26
ans.reverse()
print("".join(ans))

Submission status: Accepted

Solution code:
n = int(input())

tmp = n
ans = ''
ima = 26
while tmp > 0:
    tmp -= 1
    hiku = tmp % 26
    ans += chr(hiku+ord('a'))
    tmp -= hiku
    tmp //= ima
    
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
ans=''
check='abcdefghijklmnopqrstuvwxyz' #c(a)-1=0,c(b)-1=1,…,c(z)-1=25を対応づける文字列
while n!=0:
    n-=1
    ans+=check[n%26] #(n-1)%26がc(Sk)-1を表すので、上記の文字列を用いてc(Sk)-1からSkを求める
    n//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())

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

ans=''
while n>0:
    n-=1
    ans+=alphabet[n%26]
    n //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:

def solve(num):
  div = (num-1)//26
  rest = (num-1)%26
  if div:
    return solve(div) + chr(rest+97)
  else:
    return chr(rest+97)
  
num = int(input())
print(solve(num))

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()
lista = []
digit = 26
i = 0

while n != 0:
    opt = n % digit
    lista.insert(0, opt)
    if n % digit == 0:
        n = n // digit - 1
    else:
        n = n // digit
    i += 1

str_list = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(len(lista)):
    ans += str_list[lista[i] - 1]
print(ans)

Submission status: Accepted

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

ans = ""
for i in range(1, 99):
  if N <= 26 ** i:
    N -= 1
    for j in range(i):
      ans += d[N % 26]
      N //= 26
    break
  else:
    N -= 26 ** i
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

name = ""

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

    if n == 0:
        print(name[::-1])
        exit(0)