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:
# 1000000000000001 15
# 素因数分解的な感じで解く 26で解く
n = 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']


def base10to(n, b):
    if n/b == 0:
        return
    n -= 1
    if (int(n//b)):
        return base10to(int(n//b), b) + alphabet[n % b]
    return alphabet[n % b]


print(base10to(n, 26))

Submission status: Accepted

Solution code:
N = int(input())

alList = list('abcdefghijklmnopqrstuvwxyz')

x = 1
y = 26
z = 0
while N > y:
	z += 26**x
	x += 1
	y += 26**x
if N > 26:
	tmp = N - (z+1)
else:
	tmp = N - 1
ans = []
while tmp > 0:
	ans.append(tmp%26)
	tmp = tmp//26
str = ''
for al in ans:
	str = alList[al] + str
while len(str) < x:
	str = 'a' + str
print(str)

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

def name(n):
  if (n == 0):
    return "";
  n-=1
  return name(n//26) + chr(ord("a")+ n%26)
  
print(name(n))

Submission status: Accepted

Solution code:
def xxx(n):
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = chr(ord("a") + n%26) + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

Submission status: Accepted

Solution code:
N = int(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans = ''

while N > 0:
    N-=1
    index = N%26
    ans = alpha[index] + ans
    N = N // 26
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def base_10_to_n(x, base):
  output = []
  while True:
    a = x % base
    output.append(a)
    x //= base
    if x == 0:
      for i in range(1, len(output)):
        if output[i-1] <= 0:
          output[i] = output[i] -1
      output = output[::-1]
      if output[0] == 0:
        output.pop(0)
      break
  return output

def base_10_from_n(x, base):
  output = 0
  for i in reversed(range(len(x)-1)):
    output += base ** i
  return output


base = 26
output = base_10_to_n(N, base)

alphabet_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
name = ''
for i in output:
  name += alphabet_list[i-1]
print(name)

Submission status: Accepted

Solution code:
n=int(input())
res=""
while n!=0:
    mod=(n-1)%26
    n=(n-1)//26
    res+=chr(97+mod)
print(res[::-1])

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    lowercase = 'abcdefghijklmnopqrstuvwxyz'
    ans = ''
    for i in range(len(str(N))):
        if N == 0:
            break
        j = N % 26
        N -= 1
        N = N // 26
        ans = lowercase[j-1] + ans
        # print(N, j-1, ans)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

ans = ""

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

    ans += digit_str
    N = (N-1) // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
from math import log, floor
dic = {}    
for v1,v2 in zip(range(26),'abcdefghijklmnopqrstuvwxyz'):
  dic[v1]=v2
ans = ''
for i in range(1,99):
  if n <= 26**i:
    n-=1
    for j in range(i):
      ans += dic[n%26]
      n //= 26
    break
  else:
    n -= 26**i

print(ans[::-1])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = ""

    while N:
        N -= 1
        tmp = N % 26
        ans += chr(tmp + ord("a"))
        N //= 26

    print(ans[::-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
cher=[0]*26
ans_list=[]
flag=True

cher[0]='z'
count=1
for i in 'abcdefghijklmnopqrstuvwxy':
    cher[count]=i
    count+=1

while N>26:
    if N%26==0:
        ans_list.append(cher[N%26])
        N-=1
        N=N//26
    else:
        ans_list.append(cher[N%26])
        N=N//26
ans_list.append(cher[N%26])
print(''.join(ans_list)[::-1])

Submission status: Accepted

Solution code:
N = int(input())
a = ord("a")
name_list = []

while N>0:
    name_list.append(chr(a+(N-1)%26))
    N = (N-1)//26

name_list.reverse()
print("".join(name_list))

Submission status: Accepted

Solution code:
N = int(input())

i=0
compare_num = 26
flag = True
while(flag==True):
    if N > compare_num:
        N = N - compare_num
        i = i + 1
        compare_num = compare_num*26
    else:
        flag = False
        i = i + 1
        
tmp_str = []
if(i==1):
    tmp_str.append(chr(N+96))
else:
    for j in range(i-1):
        waru = 26**(i-(j+1))
        tmp_1 = int(N / waru)
        tmp_2 = N % waru
        if tmp_2 == 0:
            tmp_1 = int((N-1) / waru)
            tmp_2 = waru
        N = tmp_2
        tmp_str.append(chr(tmp_1+1+96))
    tmp_str.append(chr(tmp_2+96))
print(''.join(tmp_str))

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while n > 0:
    n, r = divmod(n-1, 26)
    ans = chr(r+ord('a')) + ans
print(ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()

def f(k):
    return chr(97+k)

c = 0
i = 1
while True:
    d = c+pow(26,i)
    if c < n <= d:
        break
    c = d
    i+=1

m = n-c-1

ans = ''
while m >= 26:
    ans = f(m%26) + ans
    m = m//26
ans = f(m%26) + ans

ans = 'a'*(i-len(ans)) + ans

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

print(ans[::-1])

Submission status: Accepted

Solution code:
import numpy as np
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"]
A=np.zeros(11,dtype=int)
for i in range(11):
  A[i]=(26**(i+1))
B=np.cumsum(A)
for i in range(11):
  if N<=B[i]:
    name=[" "]*(i+1)
    if i==0:
      N=N-1
    else:
      N-=B[i-1]+1
    for j in reversed(range(i+1)):
      if j>=1:
        name[i-j]=a[N//A[j-1]]
        N-=N//A[j-1]*A[j-1]
      else:
        name[i-j]=a[N]
    break

print(''.join(name))

Submission status: Accepted

Solution code:
import math
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())
alp = "abcdefghijklmnopqrstuvwxyz"
L = ""

for i in range(1,99):
    if N<=26**i:
        N -= 1
        for j in range(i):
            ind = int(N%26)
            L = alp[ind]+L
            N = (N-ind)/26
        break
    else:
        N -= 26**i
print(L)

Submission status: Accepted

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

Submission status: Accepted

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

# 10進数で与えられた番号を、26進数に直すという問題
# N番目は、それまでの桁ごとの26進数の累積和 + その桁の計算で求められる
# 26の10累乗までは範囲内.つまり犬の名前は最大で11桁になる
# 26の11乗で3670344486987776で超える

MAX_DIGIT = 11

powers = (1, 26, 676, 17576, 456976, 11881376, 
          308915776, 8031810176, 208827064576, 
          5429503678976, 141167095653376 )

# 桁数の一番最初を示すNは何になるかというと累積和で計算できる.予め計算しておく
# つまりN=1はa, N=27はaa, N=12356631はaaaaaa
digits = (0, 1, 27, 703, 18279, 475255, 12356631, 321272407,
          8353082583, 217180147159, 5646683826135, 146813779479511
)

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

  

# 桁数を減らしながら累積和配列の中から、その値以下で最も大きいものを選択していけばよい

# 桁数決定
total_digit = 0
less_than_11 = False
for i in range(1, MAX_DIGIT + 1):
  if(N < digits[i]):
    less_than_11 = True
    total_digit = i - 1
    break

if not(less_than_11):
  total_digit = 11
  
#print("{0}を犬の名前にすると、{1}桁ある.".format(N, total_digit))

# 0番地は使わない。最終的に除去する
name = [''] * (total_digit + 1)
#print("現在の名前は{0}".format(name))
for each_digit in range(total_digit, 0, -1):
  N -= 1
  num = N % 26
  N = N // 26
  name[each_digit] = abc[num]
  #print("{0}桁目はアルファベット{1}番目なので{2}で、商が{3}".format(each_digit,
  #                                              num, abc[num], N))
  #print(name)

print(''.join(name[1::]))

Submission status: Accepted

Solution code:
n = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
ans = []
while n>0:
    ans.append(al[n%26-1])
    n = (n-1)//26
print(*ans[::-1],sep="")

Submission status: Accepted

Solution code:
def xxx(n):
    alpha = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = alpha[n%26] + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

Submission status: Accepted

Solution code:
N = int(input())

t = ''
while N > 0:
    N -= 1
    t += chr(N % 26 + ord('a'))
    N //= 26
print(t[::-1])

Submission status: Accepted

Solution code:
N = int(input())

s = 26
cnt = 1
while 1:
    if N <= s:
        break
    cnt +=1
    s+=26**cnt


N = N-s+26**cnt-1
r = [0]*cnt
ans = [0]*cnt
for i in range(cnt):
    r[i] = N % 26
    N //= 26
    ans[i] = chr(ord("a")+r[i])
ans.reverse()
print("".join(ans))

Submission status: Accepted

Solution code:
N = int(input())
def translate(n):
    if n == 0:
        return "z"
    else:
        return (chr(n+96))
def solve(N):
    ans = ""
    while True:
        mod = N%26
        if mod == 0:
            N = N//26 - 1
        else:
            N = N//26
        if N == 0:
            ans = translate(mod) + ans
            return ans
            break
        else:
            ans = translate(mod) + ans
print(solve(N))

Submission status: Accepted

Solution code:
N = int(input())

S = [chr(i) for i in range(ord("a"), ord("z")+1)]

l = []
while N > 0:
    N -= 1
    r = N % 26
    l.append(r)
    N //= 26

ans = ""
for a in l:
    ans = S[a] + ans

print(ans)

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
#import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1] 
for i in range(2, 10**5 + 1):
    fact.append((fact[-1] * i) % Mod)
    inv.append((-inv[Mod % i] * (Mod // i)) % Mod)
    factinv.append((factinv[-1] * inv[-1]) % Mod)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p
    
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)
import string
def main():  #startline-------------------------------------------
    n = int(input())
    ans = ""
    while n > 0:
        n -= 1
        ans += chr(ord("a") + n % 26)
        n //= 26
    print(ans[::-1])
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Accepted

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


def solve(N):
    N -= 1

    result = []
    while True:
        div = N // 26
        mod = N % 26

        result.append(mod)
        if div == 0:
            break
        N = div - 1
    result = result[::-1]
    result = [chr(x + ord('a')) for x in result]
    print(''.join(result))




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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def L(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())

alp = list("abcdefghijklmnopqrstuvwxyz")

def div26(N):
    #print("N=",N)
    a = N // 26
    b = N % 26
    #print(a,b)
    return [a,b]

def getAlp(N):
    if N==0:
        N = 26
    return alp[N-1]

def solver(N):

    ans = ""

    x = div26(N)
    ans += getAlp(x[1])
    if x[1]==0:
        x[0] -= 1

    #print("ans=",ans)

    while x[0] > 0:
        #print("in")
        x = div26(x[0])
        ans += getAlp(x[1])
        if x[1]==0:
            x[0] -= 1

    print(ans[::-1])




def main():
    N = I()
    #print(N,K,Pn)
    solver(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

S=[]

while N>0:
    N=N-1
    S.append(chr(N%26+97))
    N=N//26
S.reverse()

Z=[str(a) for a in S]
Z="".join(Z)
print(Z)

Submission status: Accepted

Solution code:
N = int(input())
alph = {}
p = 1
for i in range(97, 97+26):
    alph[str(p%26)] = chr(i)
    p += 1
k = 0
ans = []
while(N > 0):
    ans.append(alph[str(N % 26)])
    N = (N-1) // 26
print("".join(ans[::-1]))

Submission status: Accepted

Solution code:
def dec26(X, n):
    if (int(X/n)):
        return dec26(int(X/n)-1, n)+chr(X % n + 97)
    return chr(X % n + 97)


def main():
    n = int(input())
    x2 = dec26(n-1, 26)
    print(x2)


main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
from sys import stdin
input = stdin.readline
import numpy as np


N = int(input())
al = [chr(i) for i in range(97, 97+26)]

ans = ""

while N>0:
    N -= 1
    ans += al[N%26]
    N //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

ans = ''

for i in range(1, 20):
    while n:
        n -= 1
        ans += chr(ord('a')+n%26)
        n //= 26

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def num_to_str(num):
    return chr(num + 97)

ans = []
while N > 0:
    N -= 1
    q, r = divmod(N, 26)
    ans.append(r)
    N = q
ans_alpha = list(reversed([num_to_str(i) for i in ans]))
print(''.join(ans_alpha))

Submission status: Accepted

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

name = ''
while n > 0:
  n -= 1
  name += moji[(n%26)]
  n = n // 26


print(name[::-1])

Submission status: Accepted

Solution code:
import string

cs = string.ascii_lowercase
def factor(n):
    b = 26
    ds = [n % b]
    n //= b
    while n:
        d = n % b
        ds.append(d)
        n //= b
    return ds

n = int(input())
lst = [
26
,676
,17576
,456976
,11881376
,308915776
,8031810176
,208827064576
,5429503678976
,141167095653376
,3670344486987776
,95428956661682176
]
acc = [sum(lst[:i]) for i in range(len(lst))]
for i, (an1, an) in enumerate(zip(acc, acc[1:]), 1):
    if n < an + 1:
        pos = n - an1 - 1
        fp = factor(pos)
        while len(fp) < i:
            fp.append(0)
        fp.reverse()

        print(''.join(cs[d] for d in fp))
        break

Submission status: Accepted

Solution code:
def c_one_quadrillion_and_one_dalmatians():
    N = int(input())

    ans = []
    current_val = N
    while current_val != 0:
        q, r = divmod(current_val, 26)
        if r == 0:
            r = 26
            q -= 1
        ans.append(r)
        current_val = q
    return ''.join(reversed([chr(ord('a') + a - 1) for a in ans]))

print(c_one_quadrillion_and_one_dalmatians())

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())

    abc = [chr(i) for i in range(ord("a"),ord("z")+1)]

    x=1
    y=0
    keta=0
    s=0
    while 1:
        x*=26
        y+=x
        keta+=1
        if n <= y:
            s=y-x+1
            break
    to=n-s
    ans=""
    for i in range(keta):
        ans=abc[to%26]+ans
        to=to//26

    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

Solution code:
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N = int(input())
    s = "abcdefghijklmnopqrstuvwxyz"
    ans = ""

    a = N
    while a:
        a -= 1
        a, b = divmod(a, 26)
        ans = s[b] + ans

    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N=int(input())
lista=["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"]
amari=[]
ans=""
while N!=0:
    (x,y)=divmod(N,26)
    amari.append(y)
    N=x
amari=amari[::-1]
while 0 in amari[1:]:
    for i in range(len(amari)-1):
        if amari[i+1]==0:
            amari[i]-=1
            amari[i+1]=26
if amari[0]==0:
    amari.pop(0)
for i in amari:
    ans+=lista[i-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
name = ''
l = 0
for i in range(1,99):
    if n - 26**i <= 0:
        l = i
        break
    else:
        n -= 26**i
n -= 1
for j in range(l):
    name = chr(ord('a') + n%26) + name
    n = n//26
print(name)

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
S = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while N > 0:
    N -= 1
    ans += S[N % 26]
    N //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
s = []
while n!=0:
    if n<=26:
        s.append(n)
        n = 0
    else:
        x = n % 26
        #余りが0の場合には26にする
        if not x:
            x = 26
        s.append(x)
        n = (n - 1) // 26
t = []
#求めた順番とは逆に並べる
for i in range(len(s)-1,-1,-1):
    t.append(chr(s[i]+96))
print(''.join(t))

Submission status: Accepted

Solution code:
import string
N = int(input())
alphabet = list(string.ascii_lowercase)

n = N
idxs = []
while n > 0:
    n -= 1
    idxs.append(n%26)
    n //= 26

ans = ''
for i in idxs[::-1]:
    ans += alphabet[i]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=[]
data=["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>0):
    n-=1
    ans.append(n%26)
    n=n//26
for i in range(len(ans)-1,-1,-1):
    print(data[ans[i]],end="")

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    a = 97
    tmp = 0
    index = 0
    ans = []
    for i in range(1, 12):
        pre = tmp
        tmp += 26 ** i
        if n <= tmp:
            index = i
            n = n - pre
            break
    n = n - 1
    for _ in range(0, index)[::-1]:
        ans.append(chr((n % 26) + a))
        n = n // 26
    print(''.join(ans[::-1]))








if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def resolve():
    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])
    return

resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    N = II()
    # N = 1000000000000001
    # N = 1000
    # N = 475254

    abc = [chr(i) for i in range(ord('a'), ord('z') + 1)]
    ans = []
    while N != 0:
        N -= 1
        ans.append(abc[N % 26])
        N //= 26
    printlist(ans[::-1], '')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())

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

print(num2alpha(N))

Submission status: Accepted

Solution code:
n = int(input())
alpha_arr = [chr(i) for i in range(97, 97+26)]
ans = []
while n > 0:
    n -= 1
    ans.insert(0, alpha_arr[n % 26])
    n //= 26
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num)
    if amari == 0:
        amari = 122
        N=int(N/num)-1
    else:
        amari += 96
        N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if N / num == 0:
        break

for l in name:
    S = S + l
print(str(S))

Submission status: Accepted

Solution code:
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
ans=[]
while num > 0:
  ans.append(alpha[num%26-1])
  num//=26
  if ans[-1]=='z':
    num-=1
print(''.join(ans[::-1]))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

N = int(input())
komoji = [chr(i) for i in range(97, 97+26)]

ans = ""
# print(N)
while True:
    N -= 1
    q, mod = divmod(N, 26)
    ans = komoji[mod] + ans
    # print("q: {} mod: {} ans: {}".format(q, mod, ans))
    if q == 0:
        break
    N = q
print(ans)

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori


def main():
    kazu = [0]
    for i in range(1, 14):
        kazu.append(26 ** i + kazu[i - 1])
    #    print(kazu)
    n = int(input())

    def hante(a):
        b = 0
        for i in range(len(kazu)):
            if a <= kazu[i]:
                b = i
                break
        return b

    keta = hante(n)
    ans = []
    i = keta - 1
    n -= kazu[keta - 1]+1
    ans.append(n%26)
    n//=26
    while i > 0:
        temp = n % 26
        ans.append(temp)
        n//=26

        i -= 1
    ko = list("abcdefghijklmnopqrstuvwxyz")
    ans2 = []
    for i in ans:
        ans2.append(ko[i])
    ans2.reverse()
    print("".join(ans2))


if __name__ == "__main__":

    main()

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 True:
  N-=1
  matsubi = N%26
  matsubi = chr(96+matsubi+1)
  ans += matsubi

  if N//26 == 0:
      break
  else:
      N//=26

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    alp = "zabcdefghijklmnopqrstuvwxy"
    res = ""
    for i in range(1,100):
        if(n<=26**i):
            n-=1
            for j in range(i):
                res+=chr(ord("a")+n%26)
                n//=26

            break
        else:
            n-=26**i
    print(res[::-1])

if __name__ == '__main__':
    main()

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"]
ans=[]
while n>=1:
    ans.append(a[(n-1)%26])
    n=int((n-1)/26)
ans.reverse()
name=""
for i in range(0,len(ans)):
    name+=ans[i]
print(name)

Submission status: Accepted

Solution code:
n = int(input())
h = []
tmp = ["a", "b", "c", "d", "e", "f", "g", "h","i", 
        "j", "k", "l", "m", "n", "o", "p", "q","r",
        "s", "t", "u", "v", "w", "x", "y", "z"]
name = ""

while n != 0:
    mod = n % 26
    h.append(mod)
    n //= 26
    if mod == 0:
        n -= 1
for i in h.__reversed__():
    name += tmp[i - 1]
print(name)

Submission status: Accepted

Solution code:
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"
ans = []

while n > 26:
    n -= 1
    tmp = n % 26
    ans.append(tmp)
    n //= 26

ans.append(n-1)

for i in ans[::-1]:
    print(s[i], end="")

Submission status: Accepted

Solution code:
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"
t = ""
while n > 0:
    tmp = n % 26
    if tmp == 0:
        tmp = 26
        n -= 26
    n //= 26
    t = s[tmp-1] + t    
print(t)

Submission status: Accepted

Solution code:
N = int(input())

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

l = []
s = ''
while m > 0:
    l.append((N-1)//(26**m)+1)
    N = (N-1)%(26**m)+1
    m -= 1
l.append(N)

for i in l:
    s += chr(i+96)
print(s)

Submission status: Accepted

Solution code:
N = int(input())
arr = []
while 0 < N:
    N -= 1
    arr.append(N % 26)
    N //= 26
ans = ''
for a in reversed(arr):
    ans += chr(ord('a')+a)
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


N = int(input())

tmp = 0
for i in range(1,13):
  
  tmp += 26**i
  if ( N <= tmp ):
    fct = i
    break


pre_N = N
ans_num = []

for i in range(fct):
  div = 26 ** ( fct - (i+1) )
  Q = pre_N // div
  R = pre_N %  div
  pre_N = R
  ans_num.append(Q)
  
  #print(i+1,Q,R)


#print(ans_num)
for i in range(0,fct-1):
  if ( ans_num[i]==27 ):
    ans_num[i] += -1
    ans_num[i+1] += 26

for i in range(0,fct-1):
  if ( ans_num[fct-(i+1)] <= 0 ):
    ans_num[fct-(i+1)-1] += -1
    ans_num[fct-(i+1)] += 26
#print(ans_num)

ans = []
for i in range(fct):
  chara = chr(ans_num[i]+96)
  ans.extend( chara )

print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input())
s = []
while n!=0:
    if n<=26:
        s.append(n)
        n = 0
    else:
        x = n % 26
        if not x:
            x = 26
        s.append(x)
        n = (n - 1) // 26
t = []
for i in range(len(s)-1,-1,-1):
    t.append(chr(s[i]+96))
print(''.join(t))

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.append(alphabet[n%26])
    n//=26
ans.reverse()
print(''.join(ans))