Problem:


Score : 300 points

Problem Statement

1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:

the dogs numbered 1,2,\cdots,26 were respectively given the names a, b, ..., z;

the dogs numbered 27,28,29,\cdots,701,702  were respectively given the names aa, ab, ac, ..., zy, zz;

the dogs numbered 703,704,705,\cdots,18277,18278  were respectively given the names aaa, aab, aac, ..., zzy, zzz;

the dogs numbered 18279,18280,18281,\cdots,475253,475254  were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;

the dogs numbered 475255,475256,\cdots  were respectively given the names aaaaa, aaaab, ...;

and so on.

To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names:

a, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...

Now, Roger asks you:

"What is the name for the dog numbered N?"

Constraints

N is an integer.

 1 \leq N \leq 1000000000000001

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer to Roger's question as a string consisting of lowercase English letters.

Sample Input 1

2

Sample Output 1

b

Sample Input 2

27

Sample Output 2

aa

Sample Input 3

123456789

Sample Output 3

jjddja



Sample input:
2


Sample output:
b

Submission status: Accepted

Solution code:
import 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 = [sum(26**i for i in range(p+1)) - 1 for p in range(1, 12)]
lst = [0] + lst
for i in range(1, len(lst)):
    if n <= lst[i]:
        pos = n - lst[i - 1] - 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:
import math
N=int(input())
def num2alpha(num):
    if num<=26:
        return str.lower(chr(64+num))
    elif num%26==0:
        return str.lower(num2alpha(num//26-1)+chr(90))
    else:
        return str.lower(num2alpha(num//26)+chr(64+num%26))


print(num2alpha(N))

Submission status: Accepted

Solution code:
# from copy import copy
import math
n = int(input())
ans = ''
alp = 'abcdefghijklmnopqrstuvwxyz'
cnt = 0
res = [0] * 11
for i in range(1, 11):
    res[i] = res[i-1] + 26**i
keta = 1
#print(res)
for i in range(11):
    if n > res[i]:
        keta = i
#桁数がわかる
n -= res[keta]
#print(n)
#残ったnを26進数表記すれば良い
import numpy as np
aaa = np.base_repr(n-1,26)
#print(aaa)
aaa = str(aaa)
di = {'0':'a', '1':'b','2':'c','3':'d','4':'e','5':'f','6':'g','7':'h','8':'i','9':'j','A':'k','B':'l','C':'m','D':'n','E':'o','F':'p','G':'q','H':'r','I':'s','J':'t','K':'u','L':'v','M':'w','N':'x','O':'y','P':'z'}
for i in range(len(str(aaa))):
    ans = ans + di[aaa[i]]
if keta+1 - len(ans) > 0:
    ans = 'a' * (keta+1 - len(ans) ) + ans
print(ans)
"""
cnt = 10
while True:
    k = n//(26**cnt)
    if k > 0:
        k = n//(26**cnt)
        n -= k
        ans = ans + alp[k-1]
        print(cnt)
    cnt -= 1
    if n <= 26:
        print(n)
        ans = ans + alp[n-1]
        break
    if cnt == 0:
        break
print(ans)
"""

Submission status: Accepted

Solution code:
def base_k(n, k=26):
    ret = []
    ny = n
    while ny:

        ret.append(ny % k)
        ny //= k
    return ret[::-1]


def letter(i):
    return chr(i+97)


def solve(n):
    check = 26
    cnt = 1
    k = n
    while True:
        if n <= check:
            break
        check *= 26
        check += 26
        cnt += 1
    k -= check//26 - 1
    t = base_k(k-1)
    ans = ""
    if not t:
        ans = "a" * cnt
    else:
        for _ in range(cnt):
            if not t:
                ans += "a"
                continue
            ans += letter(t.pop())

    return ans[::-1]


n = int(input())
print(solve(n))

Submission status: Accepted

Solution code:
n = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
answer = ""
while n > 0:
    n -= 1
    answer += alpha[n%26]
    n//=26
print(answer[::-1])

Submission status: Accepted

Solution code:
N = int(input())

# 桁数を決める
digit = 1  # 桁数
num = pow(26, digit) # その桁数での最大番号
while num < N:
    digit += 1
    num += pow(26, digit)

# その桁数内でのNの順番を0-indexで求める.
# (つまり, 2桁であれば'aa' -> 0, 'zz' -> 675 となる.)
order = N - (num - pow(26, digit)) - 1

# orderを26進数表記する.
# 例えば, 3桁でorder=28のとき, X = [0, 1, 2]
X = [0] * digit
cur = digit - 1
while order > 0:
    X[cur] = order % 26
    order //= 26
    cur -= 1

# 各桁の文字は'a' + Xiとなる
ans = []
a = ord('a')
for x in X:
    c = chr(a + x)
    ans.append(c)

print(''.join(ans))

Submission status: Accepted

Solution code:
import sys, collections, bisect, itertools, heapq, math, copy, string
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

    ans = ''
    radix = 26
    while N > 0:
        ans += string.ascii_lowercase[N%radix-1]
        N = (N - 1) // radix

    print(ans[::-1])

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
n=int(input())
import sys
num2alpha = lambda c: chr(c+65).lower()

ans=[]

while True:
  n-=1
  ans.append(num2alpha(n%26))
  n=n//26
  if n<26:
    if n==0:
      break
    n-=1
    ans.append(num2alpha(n%26))
    break

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


print()

# 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 = ''

BASE=26
for i in range(12,-1,-1):
    tmp = pow(BASE,i)
    if tmp > N:
        continue
    
    N-=1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
res = []
while N:
    N -= 1
    N, r = divmod(N, 26)
    res.append(chr(r + ord('a')))
res.reverse()
print(''.join(res))

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())
alpha=['z']+[chr(ord('a') + i) for i in range(26)]
list_num=[]
while n>=1:
  num=n%26
  list_num.append(num)
  if num==0:
    n-=1
  n=n//26
list_num.reverse()
list_alpha=[]
for i in list_num:
  s=alpha[i]
  list_alpha.append(s)
  
print(''.join(list_alpha))

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while n > 0:
    n -= 1
    ans = chr(n % 26 + 97) + ans
    n //= 26
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = 0
Ans_list = []
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"]
qq = n % 26
if qq == 0:
    qq = 26
Ans_list.insert(0,qq)
b = n - qq
for i in range(10000):
    po = b // 26
    po2 = po % 26
    if po2 == 0:
        po2 = 26
    Ans_list.insert(0,po2)
    b = po - po2
    if b <= 0:
        break
Ans = ""
if n <= 26:
    del Ans_list[0]
for i in range(len(Ans_list)):
    Ans = Ans +  alpha[Ans_list[i]-1]
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    n = input_number()
    ans = f(n)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
s=""
while n>0:n-=1;s+=chr(97+n%26);n//=26
print(s[::-1])

Submission status: Accepted

Solution code:
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n > 0:
  n, i = divmod(n - 1, 26)
  ans = s[i] + ans
print(ans)

Submission status: Accepted

Solution code:
g = []
def gcd(b):
    b-=1
    g.insert(0, b%26)
    if(b//26 > 0):
        gcd(b//26)
a = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
s = 0; i=0;
gcd(n)
ans = ''
for i in g:
    ans += a[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())-1
result = ""

while(1):
    tmp = n % 26
    result += chr(tmp+97)
    n = n // 26
    if n==0: break
    n -= 1
    
print(result[::-1])

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

    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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()

def Base_10_to_n(i10, n, ans_list:list):
    i10 -= 1
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []

    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))
    n26_list =[]
    for n26 in n_list:
        n26_list.append(int(n26))

    for n26 in n26_list:
        string = ord("a") + n26
        ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import string

# 1千兆 + 1
N = int(input())
n_digits = len(str(1000000000000001))
letters = string.ascii_lowercase

x = N - 1
ans = []
# while True:
#     mod = x % 26
#     ans = [ mod ] + ans
#     x = x // 26
#     if x <= 0:
#         if ans[0] == 0:
#             ans = [0] + ans
#         break

# print(ans)
# print("".join([ letters[v] for v in ans ]))

while True:
    mod = x % 26
    div = x // 26
    
    ans.append(mod)
    if div == 0:
        break
    x = div - 1

ans = ans[::-1]
# print(ans)
print("".join([ letters[v] for v in ans ]))

Submission status: Accepted

Solution code:
n = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
answer = ""
while n > 0:
  n -= 1
  answer += alpha[n%26]
  n //= 26
print(answer[::-1])

Submission status: Accepted

Solution code:
import string
from collections import deque

letters=string.ascii_lowercase

N = int(input())

ans = deque()
while True:
    N -= 1
    x = N//26
    y = N%26
    ans.appendleft(letters[y])
    N = x
    if N == 0:
        break

print(*ans, sep="")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1,12):
    if n <= pow(26,i):
        d = i
        break
    n = n - pow(26,i)
d = d - 1 
n = n - 1
ans =''
for i in range(d):
    tmp = divmod(n,pow(26,d-i))
    ans = ans+ chr(97+tmp[0])
    n = tmp[1]
print(ans + chr(97+n))

Submission status: Accepted

Solution code:
n=int(input())

cnt=1##文字数
tmp=26

while n>tmp:
    cnt+=1
    tmp+=26**cnt
 
num=n-(tmp//26)
 
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=["0"]*cnt
for i in range(cnt):
    j=num%26
    num//=26
    ans[-i-1]=alp[j]

print(*ans, sep='')

Submission status: Accepted

Solution code:
n = int(input())
eigo = 'abcdefghijklmnopqrstuvwxyz'

keta = 1
while n > 26**keta:
    n -= 26**keta
    keta += 1

ans =''
n = n-1
for i in range(keta):
    a =n // 26**(keta-1-i)
    ans += eigo[a]
    n = n % (26**(keta-1-i))
print(ans)

Submission status: Accepted

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

res += s[n - 1]
print(res[::-1])

Submission status: Accepted

Solution code:
n=int(input())

cnt=1##文字数
tmp=26

while n>tmp:
    cnt+=1
    tmp+=26**cnt
 
num=n-(tmp//26)
 
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"]
 
if n<=26:
    ans=alp[n-1]
    print(ans)
else:
    ans=["0"]*cnt
    for i in range(cnt):
        j=num%26
        ans[-i-1]=alp[j]
        num//=26
    
    print(*ans, sep='')

Submission status: Accepted

Solution code:
n = int(input())-1
result = ""
v = 11

tmp = n % 26
result += chr(tmp+97)
n = n // 26

if n!=0:
    while(1):
        n -= 1
        # print(tmp,result,n)
        tmp = n % 26
        result += chr(tmp+97)
        n = n // 26
        if n==0: break

print(result[::-1])

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    ans = []

    l = 1
    t = 0
    while True:
        if N <= t + 26 ** l:
            break
        t += 26 ** l
        l += 1

    ans = []

    N = N - t - 1
    for i in range(l):
        ans.append(chr(ord('a') + N % 26))
        N -= N % 26
        N = N // 26

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())

lis=[26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 1000000000000001]


k=0#答えが何桁になるか調べる
for i in range(len(lis)):
  if lis[i]>=n:
    k=i
    break

s=""
if k==0:
  s+=chr(n+96)
else:
  for i in range(k+1):
    n-=1
    x=int(n%26)
    s+=(chr(x+ord('a')))
    n=int(n//26)

print(s[::-1])

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res

N=II()-1
crr=[chr(97 + i) for i in range(26)]

res = []
cnt = 0
for i in range(1, 15):
    if N >= 26**i:
        cnt = i
        # print(26**i)
        N -= 26**i

# print(N)
while N:
    res.append(crr[N%26])
    N //= 26
res.reverse()
# res.append(crr[N%26])

print(("a"*(cnt+1) + "".join(res))[-(cnt+1):])

Submission status: Accepted

Solution code:
n = int(input())
num = 26
arr = []
ans = ""
moji = "abcdefghijklmnopqrstuvwxyz"
flg = False

ar = []
n = n - 1
for i in range(10000):
    arr.append(n % num)
    n = n // num - 1
    if n < 0:
        break

arr.reverse()

ans = ""

for i in arr:
    ans +=moji[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'


def calc(n, ans):
  n, i = divmod((n - 1), 26)
  ans = s[i] + ans
  if (n > 0):
    return calc(n, ans)
  else:
    return ans


ans = calc(n, '')
print(ans)

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    l = 0
    ans = ''
    for i in range(1, 12):
        if n <= 26 ** i:
            l = i
            break
        n = n - 26 ** i
    k = n - 1
    for i in range(l):
        ans = chr(k % 26 + 97) + ans
        k = k // 26

    print(ans)











if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from math import gcd
# 文字の順番を扱うとき


def ord_from_a(char):
    return ord(char) - ord('a')


def chr_from_a(n: int):
    # nはaから何番あとかを示す
    if n == -1:
        n = 25
    return chr(n + ord('a'))


N = read_a_int()
# 文字列の桁数nの決定
num = 0
for i in range(1, 100):
    num += 26**i
    if N <= num:
        break  # 桁数の決定
n = i
N -= (26 ** n - 1) // 25

ans = ''
for i in range(n):
    N, r = divmod(N, 26)
    ans = chr_from_a(r) + ans


print(ans)

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']
ans=''
while(n>0):
    n=n-1
    ans=ans+chr(ord('a')+n%26)
    n=n//26
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
ex=0
for i in range(1,100):
    ex+=26**i
    if(n<=ex):
        digit=i
        break
x=n-ex+26**digit-1
sum=''
for i in range(digit):
    q,mod=divmod(x,26)
    sum+=chr(ord('a')+mod)
    if(q==0):
        for j in range (digit-i-1):
            sum+='a'
        break
    x=q
    
    
print(sum[::-1])

Submission status: Accepted

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

for i,j in enumerate('zabcdefghijklmnopqrstuvwxy'):
    cher[i]=j

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

ans_list.append(cher[N%26])
print(''.join(ans_list)[::-1])

Submission status: Accepted

Solution code:
import os
import sys
from io import BytesIO, IOBase
import math

def main():
    #n,k=list(map(int,input().split()))
    #a=list(map(int,input().split()))
    n=int(input())
    res=""
    while n:
        n-=1
        res=chr(ord("a")+n%26)+res
        n//=26
    
    
    print(res)
# region fastio

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

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())


x = 26
y = n
ans = 'a'
while y > x:
    y -= x
    x *= 26
    ans += 'a'

y -= 1
ans = list(ans)
for i in range(len(ans)):
    x = pow(26, len(ans)-i-1)
    while y >= x:
        y -= x
        ans[i] = chr(ord(ans[i])+1)

print(''.join(ans))

Submission status: Accepted

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

for i in range(1, 15):
    if n >= 26**i:
        n -= 26**i
        continue
    ans = ""
    for j in range(i):
        ans += chr(n%26 + ord("a"))
        n //= 26
    print(ans[::-1])
    break

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:
#!/usr/bin/env python3
import itertools


n = int(input())

list_26 = [26]
while list_26[-1] < 1000000000000001:
    list_26.append(list_26[-1]*26)

list_26 = list(itertools.accumulate(list_26))
# print(list_26)

for i in range(len(list_26)):
    if n <= list_26[i]:
        break
digit = i

if i != 0:
    n -= list_26[i-1]
# print(n)

n -= 1


def base_10_to_n(x, n):
    x_dummy = x
    out = []
    while x_dummy > 0:
        out.append(int(x_dummy % n))
        x_dummy = int(x_dummy/n)
    if out == []:
        return [0]
    return out


ans = base_10_to_n(n, 26)

ans += [0]*(i+1-len(ans))
ans.reverse()

for i in ans:
    print(chr(i+97), end="")
print()
# print(ans)


# ans = base_10_to_n(n, 26)
# ans.reverse()

# for i in ans:
#     if
# print(ans)

Submission status: Accepted

Solution code:
# template by 3xC and starkizard.
# contributors: 

#####################################################################################
from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""


# from bisect import bisect_left, bisect_right, insort
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from copy import deepcopy
# from decimal import *
# import re
# import operator

#####################################################################################
# this enables you to write python3 code with PyPy2 (Python 2)
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

#####################################################################################

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""
# import threading
# threading.stack_size(1<<27)
# sys.setrecursionlimit(10000

def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    # Comment code out when you don't need inverse factorial or vice versa
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)

def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    #rdivisors=[]
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): # math.gcd is slower
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def check_sorted(a):
    ''' returns True/False '''
    for i in range(len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
def ceil(n, k=1): return n // k + (n % k != 0) #returns math.ceil but protecting against floating inconsistencies
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) #inputs integer
def mi(): return map(int, input().split()) # inputting space seperated variables for example x,y,z
def li(): return list(map(int, input().split())) #inputting a space seperated list of integers
def lw(): return input().split() #inputting a space seperated list of strings
def lcm(a, b): return abs(a * b) // gcd(a, b) #returns LCM of two arguments
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) #For printing an iterable with seperator sep as optional second argument (default : " "), ending character (default: "\n") as optional third
def dd(): return defaultdict(int) #returns a dictionary with values defaulted to 0
def ddl(): return defaultdict(list) #returns a dictionary with values defaulted to []
def write(s): return sys.stdout.write(s)












###################################################################

s="abcdefghijklmnopqrstuvwxyz"
d={}
for i in range(1,27):
    d[i]=s[i-1]

def main():
    #CODE GOES HERE:
    n=ii()
    remainders=[]
    m=n
    while(m>0):
        if m%26==0:
            remainder=26
            m=m//26 -1
        else:
            remainder=m%26
            m//=26
        remainders.append(remainder)
    for i in remainders[::-1]:
        print(d[i],end="")
    print()

    
""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

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


class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            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')
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

Submission status: Accepted

Solution code:
n = int(input())

# # 名前の長さを求める
i = 1
while 1:
    # print(i)
    if n <= 26 ** i:
        break
    else:
        n -= 26**i
    i += 1

name = ""
n -= 1
for j in range(i):
    name += chr(ord('a') + n % 26)
    n //= 26

print(name[::-1])

Submission status: Accepted

Solution code:
N = int(input())
alphabets = [chr(i) for i in range(ord('a'), ord('a') + 26)]
ans = ''

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

print(ans[::-1])

Submission status: Accepted

Solution code:
import sys
N = int(input())
moji = "abcdefghijklmnopqrstuvwxyz"

if N == 1 :
  print("a")
  sys.exit()

num = 1
keta = 0

while num <= N :
  keta += 1
  pre_num = num
  num = num * 26 + 1
  
N = N - pre_num
ans_list = [0] * keta

for i in reversed(range(keta)):
  num = 26**i
  shou = N // num
  
  
  if shou == 0:
    next
  else:
    ans_list[keta - i - 1] += shou
    N = N % num

ans =""
for i in ans_list :
  ans = ans + moji[i]
  
print(ans)

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
l=[chr(i) for i in range(97, 97+26)]
n-=1
i=1
res=0
ans=[]
while True:
    if n>=pow(26,i)+res:
        res+=pow(26,i)
        i+=1
    else:
        keta=i
        n-=res
        break
ans=""
for i in range(keta):
  r=n%pow(26,keta-i-1)
  s=n//pow(26,keta-i-1)
  ans+=l[s]
  n=r
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
n = 1#桁数
ans = ""
an = 0
alfabet = "abcdefghijklmnopqrstuvwxyz"
while(not (an<N and N<=an+26**n)):
    an = an + 26**n
    n = n+1
#桁数nを決める

mae = an
l = n-1

while(l>=0):
    k = 1
    while(mae+26**l*k < N):#l桁目を求める
        k +=1
    ans= ans+alfabet[k-1]
    if(k!=1):
        mae = mae +26**l*(k-1)
   
    l-=1
print(ans)