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


def solve(n):
    digit = 1
    digit_sum = 0
    d = 0

    while n >= digit_sum:
        digit *= 26
        digit_sum += digit
        d += 1

    n -= (digit_sum - digit)

    ans = ''
    for _ in range(d):
        n, m = divmod(n, 26)
        ans += string.ascii_lowercase[m]

    return ans[::-1]


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

Submission status: Accepted

Solution code:
import string

def Getletterfromindex(num):

    num2alphadict = dict(zip(range(1, 27), string.ascii_lowercase))
    outval = ""
    numloops = (num-1) //26

    if numloops > 0:
        outval = outval + Getletterfromindex(numloops)

    remainder = num % 26
    if remainder > 0:
        outval = outval + num2alphadict[remainder]
    else:
        outval = outval + "z"
    return outval

num = int(input())

print(Getletterfromindex(num))

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 main():
    N = int( input())
    t = 26
    ANS = []
    a = ord("a")
    # if N == 1:
    #     print("a")
    #     return
    # N -= 1
    while True:
        # if N%t == 0:
        #     ANS.append("z")
        # else:
        ANS.append( chr((N-1)%t+a))
        N = (N-1)//t
        if N == 0:
            break
    print("".join( ANS[::-1]))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

def c(n):
    return chr(ord('a') + n)

s = ""

for i in range(12):
    if N:
        N -= 1
        n = N % 26
        s = c(n) + s
        N //= 26
print(s)

Submission status: Accepted

Solution code:
n=int(input())
ans=''
while n:
  ans+=chr((n-1)%26+ord('a'))
  n=(n-1)//26
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(num2alpha(n).lower())

Submission status: Accepted

Solution code:
n = int(input())

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

print(henkan(n).lower())

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
ALPHABET = "abcdefghijklmnopqrstuvwxyz"
n = int(input()) - 1
ans = ""
while True:
    ans += ALPHABET[n % 26]
    n //= 26
    n -= 1
    if n < 0:
        break
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

TARGET = 1000000000000001
MAGIC_NUMBER = 1000

tab_pow = [0]
tmp = 0
for i in range(1, MAGIC_NUMBER + 1):
    if tab_pow[-1] >= TARGET: break
    tmp += 26 ** i
    tab_pow.append(tmp)


for n_dog in range(1, MAGIC_NUMBER + 1):
    if tab_pow[n_dog] > N - 1: break

# print("#", tab_pow, n_dog)

ans = []
N = N - 1 - tab_pow[n_dog - 1]
step = 26 ** (n_dog - 1)
for i in range(n_dog):
    # print("#", ans, N)
    for j in range(26):
        if N < step:
            break
        else:
            N -= step
    #
    ans.append(chr(ord('a') + j))
    step /= 26
        
ans = ''.join(ans)
print(ans)

Submission status: Accepted

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

    i = n%26
    if i == 0:i = 26
    n = (n-1) // 26
    mo = ord("a")+(i-1)

    ans = chr(mo) + ans
    if n == 0:
        break

print(ans)

Submission status: Accepted

Solution code:

n = int(input())
strr = []
i = 0
while n > 0:
    rem = n % 26
    if rem == 0:
        strr.append('z')
        n = (n // 26) - 1
    else:
        strr.append(chr((rem - 1) + ord('a')))
        n = n // 26
strr = strr[::-1]
print("".join(strr))

Submission status: Accepted

Solution code:
n = int(input())
n
ans = ''
st = 'abcdefghijklmnopqrstuvwxyz'
while n:
    idx = n%26
    if idx == 0:
        idx = 26
    ans += st[idx-1]
    if idx == 26:
        n-=26
    n//=26

print(ans[::-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 = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
X_dumy = N
out = ''
while X_dumy > 0:
    out = chr(ord('a') + (X_dumy - 1) % 26) + out
    X_dumy = int((X_dumy - 1) / 26)

print(out)

Submission status: Accepted

Solution code:
N = int(input())


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


print(number2alphabet(N))

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

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    n = int(sys.stdin.readline().rstrip())
    ans = ''
    while True:
        n -= 1
        ans += chr(65+32+(n % 26))
        if n < 26:
            break
        n = n // 26
    print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
N=int(input())
x=1
while 26**x<N:
    N-=26**x
    x+=1
a=[0]*x
N-=1
for i in range(x):
    a[i]=N//(26**(x-i-1))
    N%=(26**(x-i-1))
print(''.join([chr(c+ord('a')) for c in a]),sep='\n')

Submission status: Accepted

Solution code:
def colnum_string(n):
    string = ""
    while n > 0:
        n, remainder = divmod(n - 1, 26)
        string = chr(65 + remainder) + string
    return string.lower()
N = int(input())
print(colnum_string(N))

Submission status: Accepted

Solution code:
N = int(input())
temp = N
L = []

while temp != 0:
  temp -= 1
  a, b = divmod(temp, 26)
  temp = a
  L.append(chr(97+b))

L.reverse()

print("".join(L))

Submission status: Accepted

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    n = int(input().strip())
    ans = ''
    while n != 0:
        if n % 26 == 0:
            ans = 'z' + ans
            n -= 26
            n = n // 26
        else:
            ans = chr(n % 26 + ord('a') - 1) + ans
            n = n // 26
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

#1000000000000001
alpha = 'abcdefghijklmnopqrstuvwxyz'
n = ii()
tmp = n
ans = ''
while tmp > 26:
    ans += alpha[tmp%26-1]
    if tmp%26 == 0:
        tmp //= 26
        tmp -= 1
    else:
        tmp //= 26
#    print(ans,tmp)

ans += alpha[tmp%26-1]
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
if N<=26:
    print(chr(N+96))
else:
    s = ''
    tmp = N
    while True:
        ttmp = tmp%26
        if ttmp==0:
            ttmp = 26
        s = chr(ttmp+96)+s
        if tmp<=26:
            break
        tmp = (tmp-ttmp)//26
    print(s)

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()
ans = ""
while True:
	if n <= 26:
		ans = chr(96+n) + ans
		break
	else:
		po = n % 26
		if po == 0:
			po = 26
		ans = chr(96+po) + ans
		n //= 26
		if po == 26:
			n -= 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

res = []
while N != 0:
    p = N % 26
    if p == 0:
        res.append('z')
        N = (N // 26) - 1
    else:
        res.append(chr(p + 96))
        N = N // 26

res.reverse()
result = ''.join(res)
print(result)

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)
kou=N
a= num2alpha(kou)   

print(a.lower())

Submission status: Accepted

Solution code:
n = int(input())
digits = []
while n > 0:
    r = n % 26
    if r == 0:
        r = 26
    c = chr(r + ord("a") - 1)
    digits.append(c)
    n = (n-1) // 26
digits.reverse()
print("".join(digits))

Submission status: Accepted

Solution code:
N = int(input())
ans = []
while(N != 0):
	N -=1
	ans.append(N % 26)
	N = N // 26
ans_str = ''
for i in range(len(ans)):
	ans_str+=chr(97 + ans[len(ans) - i - 1])
print(ans_str)

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)
c = int(input())
ans = num2alpha(c).lower()
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:


import sys
import math
import itertools
import collections

def solve(N):
    ans = ""
    while True:
        target = N % 26
        if target == 0:
            ans += "z"
            N = N//26 - 1
        else:
            ans+=chr(ord("a") - 1 + target)
            N //= 26
        if N == 0:
            break
    return ans[::-1]
def main():
    N = int(input())
    # solve()
    print(solve(N))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# i番目は26 ^ i個
# i番目までの個数は 26 * (26 ^ i - 1) / 25

n = int(input())
_ = 96

# 桁数
ans = ''
while True:
  a, b = divmod(n, 26)
  #print(a, b)
  if b == 0:
    b = 26
    a -= 1
  ans += str(chr(b + _))
  if a == 0:
    break
  n = a
  
print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    name = ['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())
    y = N
    ans = []
    for i in range(100):
        y -= 1
        x = y%26
        y = y//26
        ans.insert(0,name[x])
        if y == 0:
            break
    
    
    print(''.join(ans))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def encode(x):
    return chr(x + 97)


N = int(input()) - 1
ans = []
while True:
    q, r = divmod(N, 26)
    ans.append(r)
    if q == 0:
        break
    N //= 26
    N -= 1
print("".join(map(encode, ans[::-1])))

Submission status: Accepted

Solution code:
n = int(input())
l = []
n -= 1
while True:
    l.append(n % 26)
    if n <= 25:
        break
    n //= 26
    n -= 1
l.reverse()
ans = ""
for i in range(len(l)):
    ans += chr(97 + l[i])
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
def num2(num):
    if num<=26:
        return chr(num+96)
    elif num%26==0:
        return num2(num//26-1)+chr(122)
    else:
        return num2(num//26)+chr(96+num%26)
print(num2(n))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ANS = []
    while N > 0:
        if N%26==0:
            ANS.insert(0,'z')
            N = N//26 -1
        else:
            ANS.insert(0,chr(N%26+96))
            N = N//26
    print(''.join(ANS))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

len = 1
cnt = 0
while cnt + pow(26, len) < N:
    cnt += pow(26, len)
    len += 1

for i in range(len):
    N -= pow(26, i)

ans = ""
for i in range(len-1, -1, -1):
    ans += chr(N//pow(26, i)+97)
    N %= pow(26, i)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
abc = 'abcdefghijklmnopqrstuvwxyz'
ans = []
n -= 1
while n >= 0:
    ans.append(abc[n%26])
    n //= 26
    n -= 1

ans.reverse()
print(*ans, sep='')

Submission status: Accepted

Solution code:
alphabets = [""] + [s for s in "abcdefghijklmnopqrstuvwxyz"]

s = int(input())

nums = []

while s > 0:
  nums.append((s - 1) % 26 + 1)
  s = (s - 1) // 26

res = ""
  
for _ in range(len(nums)):
  res = res + alphabets[nums.pop()]

print(res)

Submission status: Accepted

Solution code:
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():
    N = int(input())
    v = N

    ans = ''

    while v > 0:
        d, m = divmod(v, 26)
        if m == 0:
            d -= 1
            m = 26
        ans = chr(m + 96) + ans
        v = d

    return ans


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
str=''
while True:
  N-=1
  str=chr(N%26+ord('a'))+str
  N//=26
  if N<=0:break
print(str)

Submission status: Accepted

Solution code:
N = int(input())

def solve(n):
    if 1 <= n <= 26:
        return chr(ord('a') + (n-1) % 26)
    else:
        q, r = divmod(n, 26)
        if r == 0:
            q -= 1
            r += 26
        return solve(q) + chr(ord('a') + (r-1) % 26)

print(solve(N))

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1,100):
    if 26**i<n:
        n -= 26**i
    else:        
        break

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

lis = []
n-=1
for j in range(i-1,-1, -1):
    a = n//(26**j)
    lis.append(alpha[a])
    n = n%(26**j)

print("".join(lis))

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:
    q, mod = divmod(N, 26)
    ans = komoji[mod-1] + ans
    # print("q: {} mod: {} ans: {}".format(q, mod, ans))
    if mod == 0:
        q = q - 1
    N = q
    if q == 0:
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

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

    # s = 'zzzz'
    # tmp = 0
    # for c in s:
    #     tmp *= 26
    #     tmp += ord(c) - ord('a') +1
    # print(tmp)
        

    
main()

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while True:
  t = n%26
  if t == 0:
    ans += 'z'
    n -= 26
  else:
    ans += chr(96+t)
    n -= t
  if n <= 0:
    break
  n //= 26
    
print(ans[::-1])

Submission status: Accepted

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

N, = map(int, input().split())
lower = 'abcdefghijklmnopqrstuvwxyz'

ans = ''
while True:
    a = N % 26
    ans = lower[a-1] + ans
    if a==0:
        N = (N-1) // 26
    else:
        N = N // 26
    if N==0 :
        break

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = "abcdefghijklmnopqrstuvwxyz"
now = 0
tnp = 0
for i in range(1,1000):
    x = now + 26**i
    if (n<=x):
        tnp = i
        break
    now = x
x = n - now
ans = ""
for i in range(i):
    #print(x)
    if i==0:
        ans = a[x%26-1] + ans
    else:
        ans = a[x%26-1] + ans
    x = (x-1) // 26
    x += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

chr_start = 95
base = 26
digits = []

for i in range(13):
    res = n % base
    if res == 0:
        res = 26
    n = (n-res) // base
    digits.append(res+1)
    if n ==0:
        break
        
ans = "".join(reversed([chr(chr_start+d) for d in digits if d > 0]))
print(ans)

Submission status: Accepted

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

def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('A')+1)
    return num
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)
def main():
    N = int(input())
    num = num2alpha(N)
    ans = num.lower()
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import string
# string.ascii_lowercase

N = int(input()) - 1
strs= [string.ascii_lowercase[N % 26]]

while(N >= 26):
    N //= 26
    N -= 1
    strs.append(string.ascii_lowercase[N % 26])

for s in strs[::-1]:
    print(s, end='')
print()

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    alphas = 'abcdefghijklmnopqrstuvwxyz'
    N = read_int()
    answer = []
    while N != 0:
        d = (N%26-1)%26
        answer.append(alphas[d])
        N = (N-1)//26
    return ''.join(reversed(answer))


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

t = 1

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

ans.append(n)

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

Submission status: Accepted

Solution code:
def resolve():
    n=int(input())
    a=list('abcdefghijklmnopqrstuvwxyz')
    ans=[]
    while n>0:
        n-=1
        ans.append(a[n%26])
        n//=26
    print(''.join(map(str,ans[::-1])))

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7

N = int(sys.stdin.readline())

alp = "zabcdefghijklmnopqrstuvwxy"


def name(A, s=""):
    i = A % 26
    z = alp[i]
    s = z + s

    A = A // 26
    if i == 0:
        A -= 1
    if A > 0:
        s = name(A, s)
    return s


print(name(N))

Submission status: Accepted

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

n = int(input())

d = {(i-97+1):chr(i) for i in range(97,97+26)}
d[0] = 'z'

l = []

while n > 0:
    tmp = n%26
    l.append(tmp)
    if tmp == 0:
        n = n//26-1
    else:
        n //= 26

ans = ''

for i in l[::-1]:
    ans += d[i]
    
print(ans)

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)
x=num2alpha(num)
print(x.lower())

Submission status: Accepted

Solution code:
N = int(input())
alpha = []
while N != 0:
    a = N % 26
    if a == 0:
        a = 26
        N -= 1
    alpha.append(chr(a + 96))
    N = int(N / 26)
alpha.reverse()
print(''.join(alpha))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def name(n):
    if v := (n-1)//26:
        return name(v) + chr((n-1)%26+97)
    return chr((n-1)%26+97)

n = int(input())
print(name(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:
import string

n = int(input())
alpha = string.ascii_lowercase

l = 0
ts = 0

while n > ts:
  l += 1
  ts += 26 ** l

for i in range(l):
  n -= 26 ** i

ans = ""
for i in range(l):
  ans += alpha[(n // (26 ** (l - 1 - i))) % 26]

print(ans)

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:
def main():
    n = int(input())
    s = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    while True:
        d = n % 26
        ans += s[d - 1]
        if n <= 26:
            break
        n = (n // 26)
        if d == 0:
            n -= 1
    print(ans[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
t = []
while(n > 0):
    n -= 1
    t.append(n%26)
    n //= 26
s = ""
for i in range(1,len(t)+1):
    s += chr(t[-i]+97)
print(s)

Submission status: Accepted

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

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

print(c_one_quadrillion_and_one_dalmatians())

Submission status: Accepted

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


n = int(input())
print(str(henkan(n)).lower())

Submission status: Accepted

Solution code:
MAX_VAL = 1000000000000001
alp = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())

sum = 0
factor = 0
while sum < MAX_VAL:
    if sum <= N < sum + 26 ** factor:
        break
    sum += 26 ** factor
    factor += 1

N -= sum

ans = ''
while factor > 0:
    idx = N // (26 ** (factor-1))
    ans += alp[idx]
    N -= idx * 26 ** (factor - 1)
    factor -= 1

    #print(factor, ans)

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())-1
    ans = ""
    while N >= 26:
        ans += chr(97+(N%26))
        N //= 26
        N -= 1
    ans += chr(97+(N%26))
    print("".join(list(reversed(ans))))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
result = ""
while n > 0:
    x = n%26
    if x==0:
        result = result+"z"
        n -= 26
    else:
        result = result + chr(96+x)
    n -= x
    n //= 26
print(result[::-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力の取得
N = int(input())


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


# 求解処理
ans = num_to_alpha(N)

# 結果出力
print(ans)

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

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)
      
a = int(input())
print(num2alpha(a).lower())

Submission status: Accepted

Solution code:
n = int(input())
n -= 1
ans = []
for i in range(100):
  if n >= 26:
    n -= 26
    ans.append(chr(n%26+97))
    n //= 26
ans.append(chr(n+97))
ans = ans[::-1]
print(*ans,sep="")

Submission status: Accepted

Solution code:
N=int(input())

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

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    import sys
    sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
    to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
    print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

    # 入力を整数に変換して受け取る
    def input_int(): return int(input())

    def map_int_input(): return map(int, input())

    MII = map_int_input

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

    def MII_to_index(): return map(to_index, input())

    def MII_split_to_index(): return map(to_index, input().split())

    # 入力全てを整数に変換したものの配列を受け取る
    def list_int_inputs(): return list(map(int, input()))

    LII = list_int_inputs

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

    # 2次元リスト化
    def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

    def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

    import string
    N = input_int()
    characters = string.ascii_letters

    def base_cvt(value, n=26):
        try:
            tmp = int(value)
        except:
            raise ValueError('Invalid value:', value)

        if n < 2 or n > len(characters):
            raise ValueError('Invalid n:', value)

        result = ''
        tmp = int(value)
        while tmp >= n:
            idx = tmp % n
            result = characters[idx] + result
            tmp = int(tmp / n)
            tmp-=1

        idx = tmp % n
        result = characters[idx] + result
        return result
    print(base_cvt(N-1))
    
resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
N = int(input())

def num2alpha(n):
    ret = chr(n+ord('a')-1)
    if n==0:
        ret = 'z'
    return ret

ans = ['']
while N>0:
    t = N%26
    ans.append(num2alpha(t))
    N //= 26
    if t==0:
        N -= 1
ans.reverse()
ans = ''.join(ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def char(x):
    return chr(x + 97)

lap = 1
m = 26
while n > m:
    n -= m
    lap += 1
    m *= 26

n -= 1
ans = ''
for _ in range(lap):
    ans = char(n % 26) + ans
    n //= 26

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
al = "abcdefghijklmnopqrstuvwxyz"
name = ""
for i in range(1,12):
    b = N%26
    if b == 0:
        b = 26
    name = al[b-1] + name
    N -= b
    if N == 0:
        print(name)
        exit()
    N //= 26

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N= int(input())

buff = []
k = N
k -= 1
while True:
    k, r = divmod(k, 26)
    buff.append(r)
    if k == 0:
        break
    k -= 1

import string

print(''.join(string.ascii_lowercase[i] for i in buff[::-1]))