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

Solution (Python):
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]



def make_adjlist_d(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
        res[edge[1]].append(edge[0])
    return res


def make_adjlist_nond(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
    return res



def cmb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n - r)


def main():
    N = NI()
    S = []
    L = ""
    cnt = 0

    while N > 0:
        S.append(N % 26)

        if N % 26 == 0:
            L = "z" + L
            N = N // 26 - 1
        else:
            L = chr(S[-1] + 96) + L
            N = N // 26

    print(L)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
maxx = 1000000000000001
leng = 1
h = 0
while True:
	h += pow(26,leng)
	if h >= n: break
	leng+=1

s = ""
for i in range(leng):
	
	x = (n-1)%26
	
	s += chr(x+ord('a'))
	
	
	
	
	
	n = n//26
	if x==25: n -= 1
for i in range(leng-1,-1,-1):
	print(s[i],end="")
print()

Solution (Python):
n=int(input())

a=[]
n=n-1
while n > 25:
    a.append(n%26)
    n//=26
    n-=1

ans=""
for b in a:
    s=chr(ord('a')+b)
    ans+=s
ans+=chr(ord('a')+n)
for u in ans[::-1]:
    print(u,end="")

Solution (Python):
N = int(input())
N -= 1

alp = "abcdefghijklmnopqrstuvwxyz"



ans = ''
while N >= 0:
    j = N % 26
    if N == 0:
        ans += alp[j]
        break
    else:
        N = N // 26 - 1
        ans += alp[j]

print(ans[::-1])

Solution (Python):
N = int(input()) - 1

lb, ub = 0, 0

for n_digit in range(1, 20):
    lb = ub
    ub = (ub + 1) * 26
    

    if lb <= N < ub:
        off = N - lb
        ans = ['a' for _ in range(n_digit)]
        idx = 1
        while off > 0:
            ans[-idx] = chr(ord('a') + off % 26)
            off //= 26
            idx += 1
        
        print(''.join(ans))
        break

Solution (Python):
import itertools
N = int(input())
seq = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")

a = (N * 25 + 26) / 26
ans = 1

while a > 26:
  a /= 26
  
  ans += 1

p = (26 ** ans - 26) / 25
z = int(N - p)

ans2 = [0] * ans
for i in range(ans):
  x = N % 26
  if x == 0:
    x = 26
  N = int((N - x) // 26)
  ans2[ans - i - 1] = x
  

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

Solution (Python):
n =int(input())-1
m=0
while 26*((26**m)-1)/25<= n:
    m+=1
m-=1
n= n - 26*((26**m)-1)/25 
ans=[]
for i in range(m,-1,-1):
    ans.append(n//(26**i))
    n= n% (26**i)
w=""
for i in ans:
    w=w + chr(int(i)+97)
print(w)

Solution (Python):
n = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
answer = ""
tmp = 0
while n > 0:
    tmp = n % 26
    answer += alphabet[tmp - 1]
    n = n // 26
    if tmp == 0:
        n -= 1

print(answer[::-1])

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

s = int(input())

n = num2alpha(s)

print(n.lower())

Solution (Python):
def repeat(n):
    if n == 0: return ''
    n = n - 1
    num = n % 26
    alpha = chr(ord('a') + num)
    return repeat(n // 26) + alpha

n = int(input())
result = repeat(n)
print(result)

Solution (Python):
a=int(input())
name=""
while (a>26):
    b=a%26
    a=a//26
    if b==0:
        b=26
        a-=1
    name+=chr(b+96)
name+=chr(a+96)
name = name[::-1]
print(name)

Solution (Python):
import sys

n = int(input())

result = []
k = 26
i = 1

while k < n:
	n -= k
	k *= 26
	i += 1

length = i
n -= 1

result = []

pow26 = 26 ** (length - 1)
for i in range(length):
	letter = n // pow26 
	result.append(chr(ord('a') + letter))
	n = n % pow26
	pow26 //= 26

print("".join(result))

Solution (Python):
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())

Solution (Python):
n = int(input())

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

while n > 0:
  tmp = n % 26
  s += alphabet[tmp - 1]
  if tmp == 0:
    n = (n - 1) // 26
  else:
    n = n // 26
print(s[::-1])

Solution (Python):
import sys

q = int(sys.stdin.readline())
chars = []
while True:
    q, mod = divmod(q-1, 26)
    chars.append(chr(mod+97))
    if q < 1:
        break
chars.reverse()
print("".join(chars))

Solution (Python):
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())

Solution (Python):
n=int(input())
c=['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 = ''
tmp = 0

if n < 26:
    print(c[n-1])
    exit()

while(n > 0):
    tmp = int(n % 26)
    if tmp == 0:
        tmp = 26
    ans = c[tmp-1] + ans
    n = n - tmp
    n = n / 26

print(ans)

Solution (Python):
from math import *
a=int(input())
r=''
n=ceil(a/26)
while(n and a>0):
    n-=1
    c=a%26
    if(c!=0):
        r+=chr(97+c-1)
    else:
        r+='z'
    if(c==0):
        a=(a//26)-1
    else:
        a=a//26
print(r[::-1])

Solution (Python):
N = int(input())
NAME = 'abcdefghijklmnopqrstuvwxyz'
D = 26
name = ''

while N > 0:
  i = N % D
  name = NAME[i-1] + name
  N = int((N - i) / D)
  if i == 0:
    N -= 1
  
print(name)

Solution (Python):
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)

a=num2alpha(N)
print(str.lower(a))

Solution (Python):
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()
N -= 1

ans = ''
while N >= 0:
    d, m = divmod(N, 26)
    ans += chr(m+97)
    N = d - 1
ans = ans[::-1]
print(ans)

Solution (Python):
n=int(input())
s=""
while(n):
    a=n%26
    c=""
    if(a==0):
        c="z"
    else:
        c=chr(96+a)
    s+=c
    n=n//26
    if(c=="z"):
        n-=1
s=s[::-1]
print(s)

Solution (Python):
n = int(input())
ans = ""
alp = "abcdefghijklmnopqrstuvwxyz"












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

Solution (Python):
"""
NTC here
"""
 
 

import os
import sys
from io import BytesIO, IOBase

profile = 0
pypy = 1
 
 
def iin(): return int(input())


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


def main():
    
    n = iin()
    ans = []
    rf = ord('a')
    while n :
        x = n%26
        if x == 0:
            x = 26
        n -= 1
        n //= 26
        
        ans.append(chr(x+rf-1))
    print(''.join(ans[::-1]))






    




                

        

 
 
 
 
 
 

 
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")
 
if pypy:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
 

 
if __name__ == "__main__":
    if profile:
        import cProfile
        cProfile.run('main()')
    else:
        main()

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


temp=26
count=1
while True:
    if n<=temp:
        break
    else:
        count+=1
        temp+=26**count

unthink=temp-26**count
think=n-unthink

ans=''
think-=1
for i in range(count)[::-1]:
    now=think//(26**i)
    ans+=L[now]
    think=think%(26**i)

print(ans)

Solution (Python):
from string import ascii_lowercase as alph
N = int(input())
A = list(alph)

ans = []

def sol(n):
    global ans

    q, r = divmod(n, 26)
    ans.append(A[r])
    if q > 0:
        sol(q - 1)

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

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  

N = I()
A = [0]
for i in range(1,13):
    A.append(A[-1]+26**i)

ANS = []
for i in range(1,12):
    if N > A[i]:
        continue
    else:
        a = N-A[i-1]-1
        for j in range(i):
            ANS.append(a % 26)
            a = (a-a%26)//26
        break

ANS.reverse()

for i in range(len(ANS)):
    ANS[i] = chr(ANS[i]+97)

print(''.join(ANS))

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

Solution (Python):
x = int(input())
res = []
a=list("zabcdefghijklmnopqrstuvwxy")
while x > 0:
  if x % 26 == 0:
    res.append("z")
    x = x // 26 - 1
  else:
    res.append(a[x % 26])
    x = x // 26 

print("".join(res)[::-1])

Solution (Python):



import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

alphasm=[chr(i) for i in range(97, 97+26)]
n=I()
s=""
while n>0:
    n-=1
    x=n%26
    s+=alphasm[x%26]
    n=(n-x)//26
u=list(reversed(s))
print("".join(u))

Solution (Python):
import string


N = int(input())
S = string.ascii_lowercase

ans = ''
if N <= 26:
    ans = S[N - 1]

else:
    while True:
        N, b = divmod(N, 26)
        ans = S[b - 1] + ans
        if b == 0:
            N -= 1

        if N <= 26:
            ans = S[N - 1] + ans
            break

print(ans)

Solution (Python):

alphabet = list('abcdefghijklmnopqrstuvwxyz')
N = int(input())-1

def shin26(N):
    if(int(N/26)!=0):
        return(shin26(int(N/26)-1)+alphabet[N%26])
    return alphabet[N%26]

print(shin26(N))

Solution (Python):
n= int(input())

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

print(num2alpha(n))

Solution (Python):
from sys import stdin
import string
N = int(stdin.readline().rstrip())
alpha = string.ascii_lowercase
ans = ""

  
tmp = N
while N != 0:
    tmp = N % 26
    ans += alpha[tmp-1]
    if tmp == 0:
        N = (N-1) // 26
    else:
        N //= 26

print(ans[::-1])

Solution (Python):
n=int(input())
c=[chr(i) for i in range(97, 97+26)]
l=[]
for i in range(1,20):
  l.append(26**i)
L=[0]
for i in range(len(l)):
  L.append(L[-1]+l[i])

for i in range(len(L)):
  if n<=L[i]:
    x=i
    break
y=n-L[x-1]
ans=[]
for i in range(x-1,0,-1):
  ans.append(c[(y-1+26**i)//(26**i)-1])
  y=y%(26**i)
ans.append(c[(y-1+26)%26])
print(''.join(ans))

Solution (Python):
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())
NN=num2alpha(N)
print(NN.lower())

Solution (Python):
import sys
import math

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

def alphabet_decimal(v):
    quotient = math.floor(v / len(alphabet))
    surplus = v % len(alphabet)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(alphabet) if surplus == 0 else surplus
    result.append(surplus)
    if len(alphabet) < quotient:
        alphabet_decimal(quotient)
    elif len(alphabet) < v:
        result.append(quotient)
    return "".join([alphabet[i - 1] for i in reversed(result)])

n = int(input())
print(alphabet_decimal(n))

Solution (Python):
n = int(input())
alp = "abcdefghijklmnopqrstuvwxyz"
ans = []

while True:
    if n == 0:
        break
    ans.append(alp[n%26-1])
    n = (n - 1) // 26
ans.reverse()
print("".join(list(map(str, ans))))

Solution (Python):
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
l = []
while(1):
    if n<=26:
        if n!=0:
            l.append(n)
        break
    amari = n%26
    n = n//26
    if amari==0:
        l.append(26)
        n-=1
    else:
        l.append(amari)
a = ''
for i in l[::-1]:
    a+=s[i-1]
print(a)

Solution (Python):
N = int(input()) - 1
C = 'abcdefghijklmnopqrstuvwxyz'
res = ''
p = 1
while N - 26**p >= 0:
    N -= 26**p
    p += 1


def base(x, p):
    if int(x / p) >= 1:
        return base(int(x / p), p) + ' ' + str(x % p)
    return str(x % p)

a = list(map(int, base(N, 26).split()))

for i in range(p - len(a)):
    res += 'a'

for i in range(len(a)):
    res += C[a[i]]

print(res)

Solution (Python):
ans = []
n = int(input())
while n > 0:
    i = n % 26
    if i == 0:
        i += 26
    ans.append(chr(i + 96))
    if n % 26 == 0:
        n = n // 26 - 1
    else:
        n //= 26
ans.reverse()
print("".join(ans))

Solution (Python):
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())

Solution (Python):
N = int(input())
S = ''
while N:
	N -= 1
	S += (chr(N%26+ord('a')))
	N//=26

print(S[::-1])

Solution (Python):
import sys
import math

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"]
result = []

def alphabet_decimal(N):
    quotient = math.floor(N / len(ALPHABET))
    surplus = N % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < N:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

print(alphabet_decimal(int(N)))

Solution (Python):
N = int(input())

temp = []

while N > 0:
    q, r = divmod(N, 26)

    if r == 0:
        q -= 1
        r = 26

    N = q

    temp.append(chr(96 + r))


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

Solution (Python):
import sys

import string


characters = string.ascii_lowercase


def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except BaseException:
        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)
    idx = tmp % n
    result = characters[idx] + result
    return result


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    k = 1  
    while True:
        if n <= 26**k:
            break
        n -= 26**k
        k += 1
    ans = base_cvt(n - 1, 26)
    if len(ans) < k:
        ans = 'a' * (k - len(ans)) + ans
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())-1

A = []

Alpha = "abcdefghijklmnopqrstuvwxyz"

while True:
    N,n = divmod(N,26)
    A.append(n)
    N-=1
    if N < 0:
        break

name = ""
for i in A:
    name = Alpha[i]+name

print(name)

Solution (Python):


n = int(input())
n = n - 1
mozi_list = []
while True:
    k = n % 26
    n = n // 26 - 1
    chr_s = chr(97 + k)
    mozi_list.append(chr_s)
    if n == -1:
        break
for i in range(len(mozi_list)):
    print(mozi_list[len(mozi_list)-i-1], end="")

Solution (Python):
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

n = ni()
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n > 0:
    t = (n-1) % 26
    n = (n-1) // 26
    ans = a[t] + ans
print(ans)

Solution (Python):
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())

Solution (Python):
import numpy as np

N = int(input())
a = np.zeros(10, dtype = int)
for i in range(10):
    for j in range(1, i + 2):
        a[i] += 26 ** j
for i in range(10):
    if N <= a[i]:
        keta = i + 1
        if i == 0:
            num = N
        else:
            num = N - a[i]
        break
else:
    keta = 11
    num = N - 146813779479510
num -= 1
ans = [0 for i in range(keta)]
for i in range(keta):
    ans[keta-i-1] = num % 26 + 97
    num //= 26
u = ''
for i in range(keta):
    u += chr(ans[i])
print(u)

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

Solution (Python):
import sys
import math

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(input())
    name = ""
    while N:
        N, mod = divmod(N, 26)
        if mod ==0:
            name +="z"
            N-=1
        else:
            name += chr(96+mod)

    print(name[::-1])

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())

t = n
ans = ''
while t > 26:
    if t % 26 != 0:
        ans += chr(t % 26 + 96)
        t = int(t / 26)
    else:
        ans += 'z'
        t = int(t / 26) - 1

ans += chr(t + 96)
print(ans[::-1])

Solution (Python):
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())
nn = num2alpha(n)
print(nn.lower())

Solution (Python):
n = int(input())
alpha = [chr(ord('a') + i) for i in range(26)]
count = 1
m = n
while True:
    m -= 26 ** count
    if m > 0:
        count += 1
    else:
        m += 26 ** count
        break
keta = count
dec = m - 1

def Base_10_to_n(X, n):
    if (int(X/n)):
        a = alpha[X%n]

        return Base_10_to_n(int(X/n), n)+a
    else:
        a = alpha[X%n]
        return a

 
 


x10 = dec
x2 = Base_10_to_n(x10, 26)
if len(x2) < count:
    x2 = 'a'*(count - len(x2)) + x2
print( x2 )

Solution (Python):

n = int(input())
i = 0
buf = 0
while 26**i+buf<=n:
    buf += 26**i
    i += 1
ans = ''
for j in range(i):
    ans += chr(ord('a')+(n//(26**j)-1)%26)
    n -= 26**j
print(ans[::-1])

Solution (Python):
n = int(input())

alp = 'Zabcdefghijklmnopqrstuvwxyz'

ans = ''

while n:
    if n<27:
        ans += alp[n]
        break
    else:
        t = n%26
        if not t:
            t = 26
        ans += alp[t]
        n = (n-t)//26

ans = ans[::-1]

print(ans)

Solution (Python):
n = int(input())
e_str = [chr(ord('a') + i) for i in range(26)]
ans = []
while n>0:
    n -= 1
    i = n % 26
    
    ans.append(e_str[i])
    n = n// 26
    


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

Solution (Python):
n = int(input())-1
x = 26
d = 1
while n >= x:
  n -= x
  d += 1
  x *= 26
  
ans = ""
al = list("abcdefghijklmnopqrstuvwxyz")
tmp = pow(26,d)
for i in range(d-1,-1,-1):
  tmp //= 26 
  ans += al[n//tmp]
  n %= tmp
print(ans)

Solution (Python):
from sys import stdin
input=stdin.readline


N = int(input())

N-=1

base=ord('a')

print_string=""

while (N >= 26):
  print_string=chr(base+N%26)+print_string
  N //= 26
  N-=1


print_string=chr(base+N%26)+print_string


print(print_string)

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

Solution (Python):
n = int(input().strip())
ans=""
while n>0:
    n,mod=divmod(n,26)
    if mod==0:
        ans+="z"
        n-=1
    else:
        ans+=chr(ord("a")+mod-1)
print(ans[::-1])

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

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

Solution (Python):
N = int(input())

s = []
a = 26
tmp = 1
for i in range(20):
    s.append(tmp)
    tmp += a
    a *= 26
    if tmp > 100000000000000000:
        break

for i in range(len(s)):
    if N >= s[i]:
        continue
    else:
        size = i 
        break

b = N - s[size-1]

n2a = lambda c: chr(c+64)
a = 26 ** (size-1)

ans = []
while(a >= 1):
    ans.append(n2a(b // a + 1).lower())
    b %= a
    a //= 26

print(*ans, sep="")

Solution (Python):
n = int(input())



a = []

remain = n

while remain != 0:
  t = int(remain % 26)
  a.append(t if t != 0 else 26)
  remain -= a[-1]
  remain /= 26

tmp = ' abcdefghijklmnopqrstuvwxyz'
a.reverse()

print(''.join([tmp[i] for i in a]))

Solution (Python):
N = int(input())
ans = ""
al = "zabcdefghijklmnopqrstuvwxy"
while(N>26):
    x = N%26
    ans += al[N%26]
    N = N // 26
    if x == 0:
        N -= 1
ans += al[N%26]
ans = ans[::-1]
print(ans)

Solution (Python):
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(int(input()))

print(ans.lower())

Solution (Python):
n=int(input())

remains = []
while n > 26:
    if (n%26 == 0):
        remains.append(26)
        n = n//26 - 1
    else:
        remains.append(n%26)
        n = n//26 

remains.append(n)

ans = ''
for rem in remains:
    ans = ans + chr(ord('a')+ rem - 1)

print(ans[::-1])

Solution (Python):
N = int(input())

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

if __name__ == '__main__': 
    print(alpha(N))

Solution (Python):
def main():
    import sys
    N = int(sys.stdin.readline())
    
    
    
    
    
    al = 'zabcdefghijklmnopqrstuvwxy'
    ans =''
    while True:
        if N==0:
            break
        ans +=al[(N %26)]
        if N%26==0:
            N = N//26 -1
        else:
            N = N//26
        
    print(ans[::-1])



if __name__=='__main__':
    main()

Solution (Python):
n = int(input())
ans = []
num = [26**i for i in range(15)]
for i in range(14):
    num[i+1] += num[i]

for i in range(14):
    if n < num[i]:
        ans = [0]*i
        n -= num[i-1]
        break

num = [26**i for i in range(len(ans))]
num.reverse()

for i in range(len(num)):
    count = 0
    while n >= num[i]:
        n -= num[i]
        count += 1
    ans[i] += count

ans = [chr(i+97) for i in ans]
print(*ans, sep = "")

Solution (Python):
N=int(input())

ans=""

while True:
    B = N % 26
    A = N // 26

    if N<27:
        ans= chr(N+96) + ans
        break
    if B==0:
        B=26
        N-=26
    ans= chr(B+96) + ans

    N = N // 26


print(ans)

Solution (Python):
N = int(input())
n = 0
l = 0
while n < N:
    l += 1
    n += 26**l
cnt = [26**l for l in range(1, 12)]
n = sum(cnt[:l-1])
k = 1
s = ''
while k < l:
    i = 0
    while n+cnt[l-k-1] < N:
        i += 1
        n += cnt[l-k-1]
    s += chr(97+i)
    k += 1
s += chr(97+N-n-1)
print(s)

Solution (Python):
n = int(input())

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']
name = ''
while(True):
    m = n%26
    if(m == 0):
        m = 26
        n -= 26
    name = alp[m-1] + name
    n = n//26
    if(n==0):
        break

print(name)

Solution (Python):
N = int(input()) - 1
A = [chr(i) for i in range(ord('a'), ord('z') + 1)]
ans = ''

while True:
    ans += A[N % 26]
    if N < 26:
        break
    N //= 26
    N -= 1 

print(ans[::-1])

Solution (Python):


n = int(input())

ans = []
while n > 0:
    if n%26 == 0:
        c = 26
    else:
        c = n%26
    ans.append(chr(c+96))
    if n%26 == 0:
        n = n//26 - 1
    else:
        n = n//26

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

Solution (Python):
A=int(input())
l=[chr(i) for i in range(97, 97+26)]
let=""
for i in range(100):
   if A%26==0:
      let="z"+let
      if A//26==1:
         break
      A=A//26-1
   else:
      let=l[A%26-1]+let
      A=A//26
   if A==0:
      break
print(let)

Solution (Python):

from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce


MOD = 1000000007
INF = float('inf')
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"]
def keta(kazu): 
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers): 
    return reduce(math.gcd, numbers)

def combination(m,n): 
    
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def pow_k(x,n):  
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x

def main():    
    n = int(stdin.readline().rstrip())
    ans = ""
    while n > 0:
        n -= 1
        kazu = n%26
        ans = alpha[kazu] + ans
        n = n//26
    print(ans)
    
main()

Solution (Python):
n = int(input())

s = []
while n > 26:
    tmp = n % 26
    n //= 26
    if tmp == 0:
        n -= 1
        tmp = 26
    s.append(tmp)

s.append(n)

ans = ""
for x in s[::-1]:
    ans += chr(int(x) + 96)

print(ans)

Solution (Python):
n=int(input())
k=0
i=0
while k<=n:
	k+=26**i
	i+=1
p=i-1
r=[]
k-=26**(i-1)
n-=k
for i in range(p):
	r.append(n%26)
	n//=26
ans=""
for x in r:
	ans+=chr(ord("a")+x)
print(ans[::-1])

Solution (Python):
N=int(input())
LIST=[0]
for i in range(30):
    LIST.append(LIST[-1]+pow(26,i+1))

for i in range(29):
    if N<=LIST[i]:
        LEN=i
        break

for k in range(LEN):
    N-=pow(26,k)

ANS=[]
for i in range(LEN):
    ANS.append(N%26)
    N//=26



print("".join([chr(a+97) for a in ANS][::-1]))

Solution (Python):
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())