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):
N = int(input())
d = "abcdefghijklmnopqrstuvwxyz"
ans = ""
N -= 1

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

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

print(t[::-1])

Solution (Python):
def resolve():
    '''
    code here
    '''
    N = int(input())

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


    print(res[::-1])

if __name__ == "__main__":
    resolve()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    ans=''
    
    while n>0:
        n-=1
        a,b=divmod(n,26)
        n//=26
        ans+=chr(ord('a')+b)
    for i in ans[::-1]:
        print(i,end='')
    print()
        

    
resolve()

Solution (Python):
N = int(input())
i = 0
list26 = []
while (N > 0):
    list26.append(N%26)
    N = int(N/26)

for i in range(len(list26)):
    if(i != len(list26)-1):
        if(list26[i] <= 0):
            list26[i] = list26[i] + 26
            list26[i+1] = list26[i+1] - 1
    else:
        if(list26[i]==0):
            list26.pop(i)
            
list26.reverse()

ans = ""

for x in list26:
    ans += str(chr(ord('a')+x-1))
print(ans)

Solution (Python):
import numpy as np
N=int(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
A=np.zeros(11,dtype=int)
for i in range(11):
  A[i]=(26**(i+1))
B=np.cumsum(A)
for i in range(11):
  if N<=B[i]:
    name=[" "]*(i+1)
    if i==0:
      N=N
    else:
      N-=B[i-1]
    for j in reversed(range(i+1)):
      if j>=1:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[(N-1)//A[j-1]]
        N-=N//A[j-1]*A[j-1]
      else:
        if N==0:
          name[i-j]="z"
        else:
          name[i-j]=a[N-1]
    break

print(''.join(name))

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

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

Solution (Python):
N=int(input())
a=0
if N==1:
    print('a')
else:
    e=[0]
    t=0
    for l in range(1,15):
        t+=26**l
        e.append(t)
    for k in range(15):
        if e[k]+1<=N<=e[k+1]:
            a=k+1
            M=e[k]
            break


    ans=['a']*a
    
    b=N-M
    moji=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
    if len(ans)==1:
        ans[0]=moji[b-1]
    else:
        for j in range(0,a-1):
            c=(b-1)//(26**(a-j-1))
            ans[j]=moji[c]
            b-=(26**(a-j-1))*c
        ans[a-1]=moji[b-1]
    ans1=''.join(ans)
    print(ans1)

Solution (Python):
import sys

def I(): return int(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):

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

  mod = 26

  n2 = n
  i = 0
  while n > 0:
    i += 1
    n2 = n
    n -= mod
    if n <= 0:
      break

    mod *= 26

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


  arr.extend([0 for _ in range(i - len(arr))])
  arr.reverse()


  ref = ("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")

  print("".join([ref[a] for a in arr]))


main()

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

while True:
  if  26*(26**n-1)/25 >= N:
    break
  else:
    n +=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']
num = []

num = [0 for _ in range(n)]

for i in reversed(range(n)):
  for j in range(1,27):
    pre = 26*(26**i-1)/25
    if 26**i * j + pre >= N:
      num[i] = alpha[j-1]

      N -= 26**i * j
      break


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

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

i = 1
while True:
    if N <= 26**i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N%26)
            N //= 26
        break
    else:
        N -= 26 ** i
    i+=1
print(ans[::-1])

Solution (Python):
from collections import defaultdict

d = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g", 8:"h", \
     9:"i", 10:"j", 11:"k", 12:"l", 13:"m", 14:"n", 15:"o", 16:"p", 17:"q", \
      18:"r", 19:"s", 20:"t", 21:"u", 22:"v", 23:"w", 24:"x", 25:"y", 0:"z"}

N = int(input())
n = N
ans = ""

while n > 0:
    x = n%26
    ans += d[x]
    if(x == 0):
        n = n//26-1
    else:
        n //= 26

print(ans[::-1])

Solution (Python):


import sys
import math
from decimal import Decimal, ROUND_DOWN


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (n, ) = [int(e) for e in lines[0].split(' ')]

    return (n, )


def solve(n):

    def s(n):
        return (int(26 ** n) - 1) * 26 // 25

    d = 0
    for i in range(1, 100): 
        if s(i-1) + 1 <= n and n <= s(i):
            d = i
            break

    
    
    
    
    
    
    

    m = n - s(d- 1) - 1
    ks = []
    while True:
        k = m // 26
        r = m % 26
        ks.append(r)
        if k == 0:
            break
        m = k

    ks.reverse()

    names = 'abcdefghijklmnopqrstuvwxyz'
    result = []
    for k in ks:
        result.append(names[k])

    pad_size = d - len(result)
    result = ["a"] * pad_size + result

    return ''.join(result)
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Solution (Python):
n=int(input())
d='abcdefghijklmnopqrstuvwxyz'
x=n
s=''
n-=1
while(n>=0):
    s+=d[n%26]
    n=n//26
    n-=1
print(s[::-1])

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

Solution (Python):
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
 
def solve(n):
	
	i = 1
	maxk = 26
	while 1:
		if n<=maxk:
			ke = i
			break
		else:
			i+=1
			maxk =maxk + 26**i
	
	
	tar = n
	l= []
	while 1:
		a = tar//26
		b = tar%26
		if b==0:
			a-=1
			b = 26
		l.append(chr(ord("a")-1+b))
		tar = a
		if tar==0:
			break
 
	print("".join(l[::-1]))
 
solve(readInt())

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=list('zabcdefghijklmnopqrstuvwxyz')
result = ''
while N > 0:
  result = alphabet[N%26]+result
  if N%26==0:
    N-=1
  N//=26
print(result)

Solution (Python):
n=int(input())
ans=''
alpha='abcdefghijklmnopqrstuvwxyza'
while n>0:
    n-=1
    ans+=alpha[n%26]
    n//=26
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())
print(num2alpha(n).lower())

Solution (Python):
from collections import deque
def main():
    n = int(input())
    c = deque()
    while n:
        n -= 1
        c.appendleft(n % 26)
        n = n // 26
    cs = []
    for ce in c:
        ce += 97
        cec = chr(ce)
        cs.append(cec)
    print("".join(cs))

if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(input())
l = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

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

print(ans)

Solution (Python):
n = int(input())
alph = "abcdefghijklmnopqrstuvwxyz"

ans = ""
while n >= 1:
    n -= 1
    div, mod = divmod(n, 26)
    ans += alph[mod]
    n = div
print(ans[::-1])

Solution (Python):
from string import ascii_lowercase

N = int(input())
l = []

while N != 0:
    N -= 1
    l.append(N%26)
    N //= 26
print("".join(ascii_lowercase[x] for x in l[::-1]))

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

Solution (Python):
alp = "abcdefghijklmnopqrstuvwxyz"

n = int(input())
ans = ""
while n :
  n -=1
  mod = n % 26
  n = int(n / 26)
  ans = alp[mod] + ans

print(ans)

Solution (Python):
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = int(math.ceil(math.log((25*N/26)+1,26)))
n = int(N-(26*(26**(k-1)-1)/25))
for i in range(k):
  if i<k-1:
    if n%(26**(k-1-i))!=0:
      kre = int(n//(26**(k-1-i)))
    else:
      kre = int(n/(26**(k-1-i))-1)
    print(Alp[kre], end='')
    n -= int((26**(k-1-i))*kre)
  else:
    print(Alp[n-1], end='')

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    
    ans = []
    while N:
        mod = (N - 1) % 26
        ans.append(chr(ord('a') + mod))
        N -= 1
        N //= 26
    print(''.join(reversed(ans)))


if __name__ == '__main__':
    solve()

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

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

Solution (Python):
N = int(input())
tmp = 'abcdefghijklmnopqrstuvwxyz'
num = 26
ans = []
while N != 0:
    if N%num == 0:
        ans.append(tmp[N%num-1])
        N = N//num - 1
    else:
        ans.append(tmp[N%num-1])
        N = N//num
            
new_list = list(reversed(ans))
print(''.join(new_list))

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

ans='' 

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

Solution (Python):
t="abcdefghijklmnopqrstuvwxyz"
n=int(input())
def f(n):
    if n<=26:
        return t[n-1]
    return f((n-1)//26)+t[(n-1)%26]

print(f(n))

Solution (Python):
import sys

input = sys.stdin.readline
alp = [chr(i) for i in range(97, 97+26)]

N = int(input().rstrip())
output = ""
x = 0

while N > 26:
    output = alp[N%26 - 1] +output
    if N%26 ==0:
      N = N//26 -1
    else:
      N = N//26
output = alp[N- 1] + output
print(output)

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

while n > 0:
    div = (n-1) % 26
    s = chr(div + 97) + s
    n = (n-div-1) // 26

print(s)

Solution (Python):
N = int(input())
res = []
while N:
    r = N % 26
    if r == 0:
        r = 26
    res.append(chr(r + 96))
    if r == 26:
        N -= 1
    N //= 26
res.reverse()
print(''.join(res))

Solution (Python):

N = int(input())
S = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while N > 0:
    N -= 1
    ans += chr(ord("a") + N % 26)
    N //= 26
print(ans[::-1])

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

ans = 0
cnt = 0
add = []
sum = []
while ans < N:
    add.append(ans)
    sum.append(ans**(cnt+1))
    cnt += 1
    ans += (26**cnt)


A = N - add[cnt-1]
name =[]
for i in reversed(range(cnt)):
    if i == 0:
        div = A
    else:
        div = (A-1) // (26**i)

    if i == 0 or div == 26:
        name.append(div-1)
        A -= (div-1) * (26**i)
    else:
        name.append(div)
        A -= div * (26**i)



name_a =''
for i in range(cnt):
    name_a += chr(name[i]+97)
print(name_a)

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

left = n
ret = []

while True:
    left = left - 1
    ret.append(chr(left % 26 + ord('a')))
    left = left // 26
    if left == 0:
        break

ret.reverse()
print(''.join(ret))

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

ans=''


while(n>0):
    n=n-1
    digit=n%26
    n=n//26
    ans+=chr(97+digit)

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

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

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

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

Solution (Python):
n=int(input())
l = []
while 27 <= n:
    x = n%26
    l.append(x if x else 26)
    n = n//26 if x else n//26-1
l.append(n)
l.reverse()
print("".join(list(map(chr, map(lambda x: x+96, l)))))

Solution (Python):
N = int(input())
 
amalist = []
 
while True:
    N -= 1
    num = N % 26
    amalist.append(num)
    N = N // 26
    if N == 0:
        break
 
amalist.reverse()
 
alphalist = [chr(i) for i in range(97,97+26)]
 
result = []
for i in amalist:
    result.append(alphalist[i])
 
print(''.join(result))

Solution (Python):
N = int(input())-1
az = "abcdefghijklmnopqrstuvwxyz"
ans = []
while N >= 0:
    ans.append(az[N % 26])
    N //= 26
    N -= 1
ans.reverse()
print("".join(ans))

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

ans = ''

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

print(ans[::-1])

Solution (Python):
import sys
import os
import itertools
import numpy as np
from collections import deque

def main():
    if os.getenv("ENV")=='LOCAL':
        sys.stdin = open(os.path.dirname(__file__)+'/input.txt', 'r')

    N=int(input())

    name=[]

    while N > 0:
        N-=1
        name.append(N%26)
        N//=26

    
    
    ans=""
    for n in name:
        ans+=chr(ord('a')+n)


    print(ans[::-1])

if __name__ == '__main__':
    main()

Solution (Python):
import os
import sys
from io import BytesIO, IOBase


BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

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


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")



from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')





def main():
    n = N()
    res = ""
    while n>0:
        n-=1
        res+=chr(ord('a')+n%26)
        n//=26
    print(res[::-1])


if __name__ == "__main__":
    main()

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

def dog(n, b):
    arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y","z"]
   
    
    if (int(n/b)):
        return dog(int(n/b)-1, b) + str(arr[n%b])
    
    return str(arr[n%b])

print(dog(N-1,26))

Solution (Python):
import math
n = int(input())
name = ""
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"]

while n >= 1 / 26:
    div = n % 26
    if div == 0:
        div = 26
    name = alphabet[div - 1] + name
    n = int((n - div) / 26)
    
    
    
print(name.lower())

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


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

print(''.join([string.ascii_lowercase[bit] for bit in reversed(ans)]))

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

bitts = ''
ans = ''

dic = 'abcdefghijklmnopqrstuvwxyz'

while (N > 0):
    N -= 1
    
    b = N // 26
    mod = N - 26 * b
    bitts += str(mod)
    
    ans += dic[mod]
    
    N = N // 26
    

print(ans[::-1])

Solution (Python):
N = int(input())
alphabets = {i: chr(i + 96) for i in range(1, 26)}
alphabets[0] = 'z'

queue = []

while N > 0:
    queue.insert(0, alphabets[N % 26])
    N -= 1
    N //= 26

print(''.join(queue))

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

Solution (Python):


import sys; import math; from collections import *


def get_ints(): return map(int, input().split())
def get_list(): return list(get_ints())
def printspx(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")

UGLYMOD = int(1e9+7); SEXYMOD = 998244353; MAXN = int(1e5)




n = int(input())
ans = []
while n:
    n -= 1
    n, r = divmod(n, 26)
    ans.append(chr(ord('a') + r))
print("".join(reversed(ans)))



'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS MINE @luctivud ( UDIT GUPTA )
Link may be copy-pasted here if it's taken from other source.
DO NOT PLAGIARISE.
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''

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

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

Solution (Python):
N = int(input())
alphabets = {i: chr(i + 96) for i in range(1, 26)}
alphabets[0] = 'z'

queue = []
if N <= 26:
    print(alphabets[N])
else:
    while N > 0:
        queue.insert(0, alphabets[N % 26])
        N -= 1
        N //= 26

    print(''.join(queue))

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

ALPHABET = "zabcdefghijklmnopqrstuvwxyz"
S = ""
while N > 0:
    Q, M = divmod(N, 26)
    S = ALPHABET[M] + S
    if M == 0:
        Q -= 1
    N = Q
print(S)

Solution (Python):
i = int(input())
nexti = 0
nextii = 0
ans = str()
nextans = str()


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

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

abc = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while N > 0:
    N -= 1
    ans = abc[(N%26)] + ans
    N //= 26
print(ans)

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

if __name__=="__main__":
    
    N = int(input())
    ans = ''
    while N > 0:
        N -= 1
        ans += alphabet_list[N % 26]
        N = N // 26

    print(ans[::-1])

Solution (Python):
n = int(input()) - 1
ans = ""
for _ in range(13):
    ans += chr(ord("a") + (n%26))
    n //= 26
    if n == 0:
        break
    n -= 1
print(ans[::-1])

Solution (Python):
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft



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

    ans = []
    for i in range(20):
        if n == 0:
            break
        n -= 1
        ans.append(n%26)
        n //= 26

    print("".join(chr(ord('a') + i) for i in ans[::-1]))
main()

Solution (Python):
n = int(input())
ans = ''
while n:
    x = n % 26
    if x != 0:
        ans += chr(x + 96)
    else:
        ans += 'z'
        n -= 1
    n //= 26
        
print(ans[::-1])

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

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


c=1
while 1:
    if n-26**c<=0:
        break
    else:
        n=n-26**c
        c+=1


d=[]
n-=1
for i in range(c-1):

    d.append(n//(26**(c-1-i)))
    n=n-(26**(c-1-i))*(n//(26**(c-1-i)))
d.append(n)


s=[]
for j in range(c):
    s.append(chr(ord('a')+d[j]))
print(''.join(s))

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy
from string import ascii_lowercase


sys.setrecursionlimit(10**6)

count = 0

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

if __name__ == '__main__':
    N = int(input())
    
    
    main(N)

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)

ans = num2alpha(N)

print(ans.lower())

Solution (Python):
def resolve():
	N = int(input())
	base = 26
	char_a = 97
	s = ''
	while N > 0:
		N -= 1
		s = chr(char_a + N%base) + s
		N = N//base
	print(s)
resolve()

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

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

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

print(num2alpha(a))

Solution (Python):
N = int(input())-1
if N == 0:
	print("a")
else:
	ans = ""
	while N >= 0:
		ans += chr(N % 26 + 97)
		N //= 26
		N -= 1
	print(ans[::-1])

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

ans=num2alpha(num).lower()

print(ans)

Solution (Python):
N = int(input())
ans = ""
b = []
c = 0
while N > 0:
    b.append((N-1)%26)
    N = int((N-1)/26)
    c = c + 1

for i in range(c):
    ans = chr(b[i]+97) + ans

print(ans)

Solution (Python):
N = int(input())
remain = N
i = 0
huyou = 0
dog = []
while (remain > 0):
    kurai = 26**i
    ans = remain // kurai
    keta = ans % 26
    if keta == 0:
        keta += 26
    dog.append(keta)
    huyou = keta * kurai
    remain -= huyou
    i += 1
out = ""
for j in reversed(dog):
    out += chr(j+96)
print(out)

Solution (Python):
ans = ""

N = int(input())

for i in range(10000):
    N -= 1
    tmp = N%26
    ans += chr(97+tmp)
    N //= 26
    if N <= 0:
        break

print(ans[::-1])

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

n = int(input())

d = {(i-97+1)%26:chr(i) for i in range(97,97+26)}


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)

Solution (Python):


N = int(input())

bitts = ''
ans = ''

dic = 'abcdefghijklmnopqrstuvwxyz'

while (N > 0):
    N -= 1
    
    b = N // 26
    mod = N - 26 * b
    bitts += str(mod)
    
    ans += dic[mod]
    
    N = N // 26
    

print(ans[::-1])

Solution (Python):


import sys
import math
from decimal import Decimal, ROUND_DOWN


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (n, ) = [int(e) for e in lines[0].split(' ')]

    return (n, )


def solve(n):

    def s(n):
        return (int(26 ** n) - 1) * 26 // 25

    d = 0
    for i in range(1, 100): 
        if s(i-1) + 1 <= n and n <= s(i):
            d = i
            break

    m = n - s(d- 1) - 1
    ks = []
    while True:
        k = m // 26
        r = m % 26
        ks.append(r)
        if k == 0:
            break
        m = k

    ks.reverse()

    names = 'abcdefghijklmnopqrstuvwxyz'
    result = []
    for k in ks:
        result.append(names[k])

    pad_size = d - len(result)
    result = ["a"] * pad_size + result

    return ''.join(result)
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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

s = []
k = 0
while N > 0:
	l = N % 26 
	if l == 0:
		l = 26
	s.insert(0,chr(ord('a')+l-1))
	N = N-1
	N = N // 26
	k +=1


print(''.join(s))

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

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

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

def slove():
    n = int(input())
    ans = ""
    abc = "zabcdefghijklmnopqrstuvwxy"
    count = 0
    while n != 0:
        k = n % 26
        if k == 0:
            n -= 1
        n = n // 26
        ans = abc[k] + ans
        
    print(ans)


if __name__ == "__main__":
    slove()

Solution (Python):
import sys
import math

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

def ad(v):
    q = math.floor(v / len(a))
    s = v % len(a)
    q -= 1 if s == 0 else 0
    s = len(a) if s == 0 else s
    res.append(s)
    if len(a) < q:
        ad(q)
    elif len(a) < v:
        res.append(q)
    return "".join([a[i - 1] for i in reversed(res)])

st1 = input()
st = int(st1)
print(ad(st))

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

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

print(ans[::-1])

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

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

    n = n // 26

print(ans[::-1])

Solution (Python):
n=int(input())
ans=''
while n>0:
    x=n%26
    if x!=0:
        ans+=chr(x+96)
    else:
        ans+='z'
        n-=1
    n=n//26
print(ans[::-1])

Solution (Python):
n = int(input())
ans = ''
i = 1
while n > 0 :
    x = n % 26
    if x != 0:
        ans += chr(x+96)
    else:
        ans += 'z'
        n -= 1
    n = n//26
print(ans[::-1])