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:
from collections import deque


def main():
    n = int(input())
    base = 26
    orig = ord('a')
    ans = deque()
    for exp in range(1, 12):
        if (tmp := pow(base, exp)) >= n:
            n -= 1  # zero_indexed for ASCII mod
            for digit in range(exp):
                ans.appendleft(chr(orig + n % base))
                n //= base
            break
        else:
            n -= tmp
    print(''.join(ans))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
r = 26
d = 1
while n-r > 0:
    n -= r
    r *= 26
    d += 1
n -= 1
name = ''
for i in range(d):
    if n >= 26:
        name = a[n % 26]+name
        n //= 26
    elif n > 0:
        name = a[n]+name
        n = 0
    else:
        name = a[n]+name
print(name)

Submission status: Accepted

Solution code:
N=int(input())
P=["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:
  t=(N-1)%26
  ans.append(P[t])
  N=int((N-t)/26)
  continue
ans=ans[::-1]
print("".join(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)
            # ord()の引数に文字を指定するとそのユニコードがintで帰ってくる，
            # chr()に整数を指定すると文字がstrで返ってくる
            N //= 26
        break
    else:
        N -= 26 **i


print(ans[::-1]) #stepが-1つまり後ろから表示

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:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    res = []
    while n:
        n, r = divmod(n - 1, 26)
        res.append(chr(ord('a') + r))
    res.reverse()
    print(''.join(res))
resolve()

Submission status: Accepted

Solution code:
def INT():
    return int(input())

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

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

from string import ascii_lowercase

al = ascii_lowercase

N = INT()
ans = []

while N > 0:
    N -= 1
    ans.append(al[N % 26])
    N //= 26
    
ans.reverse()
print("".join(map(str, ans)))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n = readint()

a = ['z'] + [chr(ord('a')+i) for i in range(25)]
ans = []
while n:
    ans.append(a[n%26])
    n = (n-1)//26

ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n = readint()

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

ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

l = []

for _ in range(20):
  rem = n % 26
  l.append(rem - 1 if rem else 25)
  n = (n - 1) // 26
  if n == 0:
    break;

l.reverse()
print("".join([alphabet[i] for i in l]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
alp = [chr(i) for i in range(97, 97+26)]
edge = [0] * 15
for i in range(1, 15):
    edge[i] = edge[i - 1] + pow(26, i)

d = 0
length = 0
for e in edge[::-1]:
    if n - e > 0:
        d = n - e - 1 #!
        length = edge.index(e) + 1 # 文字数
        break

digit = []
for _ in range(length):
    digit.append(d % 26)
    d //= 26

res = ''
for di in digit:
    res += alp[di]

print(res[::-1])

Submission status: Accepted

Solution code:
num = int(input())

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

print(num2alpha(num).lower())

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())

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

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

print(''.join(a))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def conv(n):
    n+=97
    return chr(n)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def conv(a): #convert the num to character
  a += 97
  return chr(a)

# 整数の入力
n = int(input())
name = ''

while n>0:
  n -= 1
  name += conv(n%26)
  n //= 26

# 出力
print(name[::-1])

Submission status: Accepted

Solution code:
# 数値→アルファベット
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
n=num2alpha(int(input()))
n=str(n.lower())
print(n)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    L = [chr(i) for i in range(97, 97 + 26)]

    res = ""
    while n:
        r = n % 26
        res += L[r - 1]
        n = max(0, (n - 1)) // 26
    print(res[::-1])


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
N = int(input())

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

print(num2alpha(N).lower())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
while N > 0:
    N -= 1
    ans += chr(N%26+97)
    N //= 26
print(ans[-1::-1])

Submission status: Accepted

Solution code:
n=int(input())

ans=""
d="abcdefghijklmnopqrstuvwxyz"
while n!=0:
    n-=1
    ans+=d[n%26]
    n//=26

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
n = N
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in range(1,12):
    
    if n <= 26 ** i:
        digits = i
        break
    else:
        n -= 26 ** i
#print("桁数は{0}桁".format(digits))
n -= 1
output = ""
for j in range(digits-1):
    amari = n % 26
    n //= 26
    output = alpha[amari] + output
output = alpha[n] + output
print(output)

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:
import sys
import numpy as np
import math
import collections
from collections import deque 
from functools import reduce

# input = sys.stdin.readline
n = int(input())
ret = ''
while(n > 0):
    n -= 1
    ret += chr(ord('a') + n % 26)
    n //= 26
print(ret[::-1])

Submission status: Accepted

Solution code:
n=int(input())

ans=""
d="abcdefghijklmnopqrstuvwxyz"
while n!=0:
    n-=1
    ans+=d[n%26]
    n//=26

print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
l="abcdefghijklmnopqrstuvwxyz"
for r in range(0,11):
    start=0
    for x in range(r+1):
        start+=26**x
    end=start+26**(r+1)-1

    if start<=n<=end:
        o=[]
        for x in range(r+1)[::-1]:
            o.append(l[((n-start)//(26**x))%26])
        print("".join(map(str,o)))
        exit()

Submission status: Accepted

Solution code:
n = int(input())

i = 1
ans = ""
while n != 0:
    p = n%26 if n%26 != 0 else 26
    ans  = chr(p + 96) + ans

    n = n-p
    n = n//26
    i += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

alpha = [chr(x) for x in range(97, 123)]

def N_to_al(N, res):
  x = N // 26
  r = N % 26
  res += alpha[r-1]
  
  if r == 0:
    x = x - 1
  if x > 0:
    return N_to_al(x, res)
  else:
    return res

res = N_to_al(N, "")
res = res[::-1]
print(res)

Submission status: Accepted

Solution code:
n = int(input())

nn=n
i=1
while nn > 26**i:
    nn-=26**i
    i+=1

an=['a']*i
j=0
while n:
    n-=1
    wk=n%26
    an[j]=(chr(ord('a')+wk))
    n = n//26
    j+=1
    
an.reverse()
print(''.join(an))

Submission status: Accepted

Solution code:
def numtoalph(x):
  if x<=26:
    return chr(96+x)
  elif x%26==0:
    return numtoalph(x//26-1)+'z'
  else:
    return numtoalph(x//26)+chr(96+x%26)

print(numtoalph(int(input())))

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from bisect import bisect_left
    input = sys.stdin.readline

    N = int(input())

    A = [1]
    a = 1
    for i in range(1, 10000):
        a += 26**i
        A.append(a)
        if a > 1000000000000001:
            break

    i = bisect_left(A, N+1)
    N0 = A[i]
    K = N - N0
    ans = [97] * i
    for j in range(i):
        ans[-j-1] += K % 26
        K //= 26
    print("".join(map(chr, ans)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

ans = ''

def conn(n):
  global ans
  h,r = divmod(n, 26)
  if r == 0:
    r = 26
    h -= 1
  ans = al[r] + ans
  #print(h,r,ans)
  if h > 0:
    conn(h)

conn(N)
print(ans)

Submission status: Accepted

Solution code:
def solve(N):
    ans = ""
    while N > 0:
        q,r = N // 26,N % 26
        if r == 0:
            q -= 1
            r = 26
        ans = chr(96 + r) + ans
        N = (N - r) // 26

    return ans

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

    print(solve(N))

if __name__ == "__main__":
    main()

Submission status: Accepted

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


def main():
    from string import ascii_lowercase
    import sys
    input = sys.stdin.readline

    n = int(input())
    ans = ''
    alpha = list(ascii_lowercase)

    while n >= 26:
        p, q = divmod(n, 26)

        ans += alpha[q - 1]
        n = p

        if q == 0:
            n -= 1

    if 0 < n < 26:
        ans += alpha[n - 1]

    print(ans[::-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input()) - 1
    digit = 1
    while N >= 26 ** digit:
        N -= 26 ** digit
        digit += 1
    buf = []
    a = ord("a")
    for i in range(digit):
        buf.append(chr(a + (N % 26)))
        N //= 26
    ans = "".join(buf[::-1])
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#関数リスト
import sys
input = sys.stdin.readline
 
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

num = I()
result = ""
alphabet = [chr(ord('a') + i) for i in range(26)]

while True:
    num -= 1
    result = alphabet[num % 26] + result
    num //= 26
    if num == 0:
        break
print(result)

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):
    d=N%26
    ans+=chr(d +ord('a'))
    N//=26
  ans=ans[::-1]
  break
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 string
s = string.ascii_lowercase


def f(x, tmp):
    if x == 0:
        return ""
    x -= 1
    if x < 26:
        return s[x] + tmp
    else:
        return f(x // 26 , s[x % 26] + tmp)


n = int(input())
r = f(n, "")
print(r)

Submission status: Accepted

Solution code:
#10進数から26進数への変換の問題
#与えられた数を26で割った余りがa~zに対応する
st="Xabcdefghijklmnopqrstuvwxyz"
ans=""
kazu=int(input())
while(True):
    add=kazu%26
    if(add==0):#0の時zにするため
        add=26
    ans=st[add]+ans#アルファベットを後ろから加えてく
    kazu-=add#余りを引く
    if(kazu==0):#数が0になったら終わり
        break
    kazu=kazu//26#26で割って切り捨て

print(ans)

Submission status: Accepted

Solution code:
import sys


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


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    N = int(input())
    answer = ""

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

    print(answer[::-1])


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 = n//26

print(ans[::-1])

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:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

def main():
    n = int(input())
    ans = ""
    alpa = "abcdefghijklmnopqrstuvwxyz"
    while n:
        ans += alpa[n%26-1]
        n-=1
        n//=26
    ans2 = ""
    for i in range(len(ans)):
        ans2 += ans[len(ans)-i-1]
    print(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())
r = []
while (True):
    n = n - 1
    r.append(chr(n % 26 + ord("a")))
    n = n // 26
    if n == 0:
        break
print("".join(reversed(r)))

Submission status: Accepted

Solution code:
#ABC 171 C - One Quadrillion and One Dalmatians 10:59

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc171/tasks/abc171_c

n=[int(i) for i in input().split()]

now=n[0]
li=[]
while now>26:
    if now%26!=0:
        li.append(now%26)
        now=now//26
    else:
        li.append(26)
        now=now//26-1
    #print(li)
li.append(now)

#print(li)
ans=""
for i in li:
    ans+=chr(96+i)

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
res = ''
while n > 0:
    n, t = divmod(n, 26)
    if t == 0:
        t = 26
        n -= 1
    res += chr(96+t)

print(res[::-1])

Submission status: Accepted

Solution code:
#N, K = map(int, input().split())
#p = list(map(int, input().split()))

n = int(input())
res = str()
while 0 < n:
    n -= 1
    r = n % 26
    res += chr(r+ord('a'))
    # print(res)
    n //= 26
 
print(res[::-1])

Submission status: Accepted

Solution code:
N = int(input())

alphabets = [chr(i) for i in range(97, 97+26)]
x = N
ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
def solve(n):
    s = [chr(ord("a")+i) for i in range(26)]
    res = ""
    while n > 0:
        n -= 1
        res = s[n % 26] + res
        n //=26
    return res

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

Submission status: Accepted

Solution code:
n = int(input())
res = ''
while n > 0:
    n, t = divmod(n, 26)
    if t == 0:
        t = 26
        n -= 1
    res += chr(96+t)
print(res[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
num=0
ans=""
for i in range(1,99):
    if 26**i >= N:
        N-=1
        for j in range(i):
            ans+=chr(97+N%26)
            N//=26
        break
    else:
        N-=26**i
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
res = ''
while 0 < n:
    n -= 1
    r = n % 26
    res += chr(r+ord('a'))
    # print(res)
    n //= 26

print(res[::-1])

Submission status: Accepted

Solution code:
n=int(input())
ans=""
while n>0:
    n-=1
    ans+=chr(97+n%26)
    n=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-=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())
kouho = [chr(i) for i in range(97, 97+26)]
ans = []
while n>0:
    n-=1
    ans.append(kouho[n%26])
    n = n//26
ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def convert(num):
    i, n = 1, 26
    while n < num:
        num -= n
        n *= 26
        i += 1
    num -= 1
    
    res = ''
    while num >= 26:
        res = alphabet[num % 26] + res
        num //= 26
    return '{:{fill}{align}{width}}'.format(alphabet[num % 26] + res, fill='a', align='>', width=i)

print(convert(int(input())))

Submission status: Accepted

Solution code:
n = int(input())

alphabet = 'abcdefghijklmnopqrstuvwxyz'


def name(n):
    if n <= 26:
        return alphabet[n - 1]
    else:
        return name((n - 1) // 26) + name(n % 26)


print(name(n))

Submission status: Accepted

Solution code:
def solve():
    n=int(input())
    ans=''
    check='abcdefghijklmnopqrstuvwxyz'
    while n!=0:
        n-=1
        ans+=check[n%26]
        n //= 26
    print(ans[::-1])
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()-1

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

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())
x = 1
alphabet = {i-96:chr(i) for i in range(97, 97+26)}
if int(N) > 26:
    ans = ''
    while x != 0:
        x = N // 26
        mod = N%26
        #print(x, mod)
        if mod == 0:
            ans += 'z'
            #x -= x%26
            x -= 1
        else:
        #print(x, mod, alphabet[mod])
            ans += alphabet[mod]
        N = x
else:
    ans = alphabet[int(N)]
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
#x,n=map(int,input().split())
#pl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

res=''

# 文字数を求める
total=0
i=1
while True:
    if total+26**i>=n:
        break
    else:
        total+=26**i
        i+=1

# 文字数iがわかったので，そのなかでn-i番目
k=n-total-1
for j in range(i):
    res+=chr(ord('a')+k%26)
    k=k//26

print(res[::-1])

Submission status: Accepted

Solution code:
N = int(input())

txt = ''
while N > 0:
    N -= 1

    ama = N % 26
    digit = chr(ord('a') + ama)
    txt += digit
    N = N//26

print(txt[::-1])

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

    ans = ''
    al=[chr(ord('a') + i) for i in range(26)]

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

    print(ans[::-1])
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
al = [chr(97+i) for i in range(26)]
n = int(input())
res = ""
while n > 0:
    n -= 1
    res += al[n%26]
    n = int(n/26)
print(res[::-1])

Submission status: Accepted

Solution code:
alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
n=int(input())
ans=""
while n>0:
 n-=1
 a=n%26
 ans+=alp[a] 
 n=int(n//26)
 
print(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):
    n-=1
    ans += chr(ord('a')+(n%26))
    n = n//26

print(ans[::-1])

Submission status: Accepted

Solution code:
import sys

if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


def solve():
    s = numberToBase(n, 26)
    for i in reversed(range(len(s))):
        if s[i] <= 0:
            if i-1 >= 0:
                s[i] += 26
                s[i-1] -= 1
            else:
                s.remove(0)
    #print(s)
    ans = [chr(int(c) + ord("a")- 1) for c in s]
    print "".join(ans)
    return


def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]

n = RN()
solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	N = int(input())
	a = ord('a')
	ans = ''
	while N!=0:
		N -= 1
		ans = chr(a + N % 26) + ans
		N //= 26
	print(ans)

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())
alp = 'abcdefghijklmnopqrstuvwxyz'
ans = []
while n > 0:
  n -= 1
  x = n%26
  ans.append(x)
  n //= 26
ans.reverse()

a = ''
for i in ans:
  b = alp[i]
  a += b
print (a)

Submission status: Accepted

Solution code:
n=int(input())
out=""
while(1):
    n-=1
    asc=n%26
    asc=97+asc
    out+=chr(asc)
    n=(n//26)
    if(n<=0):
        break

print(out[::-1])

Submission status: Accepted

Solution code:
N = int(input())
en_list = "abcdefghijklmnopqrstuvwxyz"
answer = ""
while N > 0:
    r = N % 26
    if r == 0:
        r = 26
    answer = en_list[r-1] + answer
    N = (N - r) // 26
print(answer)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np
input = sys.stdin.readline
n=int(input())
Z = [chr(i) for i in range(97, 97+26)]
ans = ""
def div(k):
    k ,mod = divmod(k, 26)

    global ans
    ans += Z[mod-1]
    if mod == 0:
        return k-1
    else:
        return k


for i in range(20):
    n = div(n)
    if n == 0 and len(ans)==1:
        print(ans)
        sys.exit()

    elif n ==0 :
        print(ans[::-1])
        sys.exit()

sys.exit()

Submission status: Accepted

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

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

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


print(str.lower(num2alpha(n)))

Submission status: Accepted

Solution code:
alphabet='abcdefghijklmnopqrstuvwxyz'
N=int(input())
name=''
while N>0:
  N-=1
  name+=alphabet[N%26]
  N//=26
print(name[::-1])

Submission status: Accepted

Solution code:
N = int(input())-1
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 True:
  temp = N % 26
  N = int(N/26)
  ans = alpha[temp] + ans
  
  if N == 0:
    break
  else:
    N -= 1
    
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

ans = ""
def n(N):
    ans= ""
    for i in range(N):
        if N%26 ==0:
            ans = "z" +ans
            N -= 1
        else:
            ans = chr(64+ N%26) +ans
        
        if N <= 26:
            break
        N = N // 26
    return ans
    

print(n(N).lower())

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 = ''
cnt = 0
while n!=0:
  r = n%26
  if r==0:
    ans += 'z'
    r = 26
  else:
    ans += chr(96+r)
  n -= r
  n //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
import sys



def solve(n):
    #print(n)
    NCHARS = int(26)
    MAXVAL = NCHARS
    ndigs = 1
    while n > MAXVAL:
        ndigs += 1
        n -= MAXVAL
        MAXVAL *=  NCHARS
    # now have # digs
    #print(n,ndigs,MAXVAL)
    n -= 1
    result = ''
    while n > 0:
        #print(n,MAXVAL,NCHARS)
        #MAXVAL //= NCHARS
        result += chr(n%NCHARS + ord('a'))
        n //= NCHARS
        #d = n // MAXVAL
        #d = n // MAXVAL
        #print(n,MAXVAL,result)
    if len(result) < ndigs:
        result += ''.join(['a' for i in range(ndigs-len(result))])
    print(''.join([c for c in result][::-1]))
        

        


if __name__ == '__main__':
    IN = [x.strip() for x in sys.stdin.readlines()]

    n = int(IN[0])
    solve(n)

Submission status: Accepted

Solution code:
N=int(input())

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
        
print(num2alpha(N).lower())

Submission status: Accepted

Solution code:
def int2chr(n: int):
    if n == 0:
        return 'z'
    else:
        return chr(n + 96)


n = int(input())

name = ""
pow_index = 1
while True:
    m = n % 26
    name = int2chr(m) + name
    n -= m
    n //= 26
    if m == 0:
        n -= 1
    if n == 0:
        break
print(name)

Submission status: Accepted

Solution code:
n = int(input())
rev = []
nn = n
def c(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return n

def d(n):
    k = 1
    i = 1
    while n > 26 ** i:
        n -= 26 ** i
        k += 1
        i += 1
    return k

n = c(n) - 1
while n > 25:
    r = n % 26
    rev.append(r)
    n //= 26
rev.append(n)
sl = list('abcdefghijklmnopqrstuvwxyz')
l = len(rev)
name = []
for i in range(d(nn) - l):
    name.append('a')
for i in range(len(rev)):
    d = sl[rev[l - 1 - i]]
    name.append(d)
dogname = ''.join(name)
print(dogname)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans[::-1])