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




from __future__ import division, print_function 

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


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













if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

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



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

"""Uncomment next 4 lines if doing huge recursion"""




def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

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

    return fact, ifact

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

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


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

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



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



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



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

def gcd(x, y): 
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def check_sorted(a):
    ''' returns True/False '''
    for i in range(len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
def ceil(n, k=1): return n // k + (n % k != 0) 
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) 
def mi(): return map(int, input().split()) 
def li(): return list(map(int, input().split())) 
def lw(): return input().split() 
def lcm(a, b): return abs(a * b) // gcd(a, b) 
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) 
def dd(): return defaultdict(int) 
def ddl(): return defaultdict(list) 
def write(s): return sys.stdout.write(s)














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

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

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

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

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

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

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

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

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

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


class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')


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



""" main function"""

if __name__ == '__main__':
    main()

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


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

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

print(name[::-1])

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

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

print(ans[::-1])

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

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

num = 1
keta = 0

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

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

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

Solution (Python):


import math



from collections import deque
from collections import Counter




n=int(input())
l=[chr(i) for i in range(97, 97+26)]
n-=1
i=1
res=0
ans=[]
while True:
    if n>=pow(26,i)+res:
        res+=pow(26,i)
        i+=1
    else:
        keta=i
        n-=res
        break
ans=""
for i in range(keta):
  r=n%pow(26,keta-i-1)
  s=n//pow(26,keta-i-1)
  ans+=l[s]
  n=r
print(ans)

Solution (Python):
N = int(input())
n = 1
ans = ""
an = 0
alfabet = "abcdefghijklmnopqrstuvwxyz"
while(not (an<N and N<=an+26**n)):
    an = an + 26**n
    n = n+1


mae = an
l = n-1

while(l>=0):
    k = 1
    while(mae+26**l*k < N):
        k +=1
    ans= ans+alfabet[k-1]
    if(k!=1):
        mae = mae +26**l*(k-1)
   
    l-=1
print(ans)

Solution (Python):


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


def base10to(n, b):
    if n/b == 0:
        return
    n -= 1
    if (int(n//b)):
        return base10to(int(n//b), b) + alphabet[n % b]
    return alphabet[n % b]


print(base10to(n, 26))

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

alList = list('abcdefghijklmnopqrstuvwxyz')

x = 1
y = 26
z = 0
while N > y:
	z += 26**x
	x += 1
	y += 26**x
if N > 26:
	tmp = N - (z+1)
else:
	tmp = N - 1
ans = []
while tmp > 0:
	ans.append(tmp%26)
	tmp = tmp//26
str = ''
for al in ans:
	str = alList[al] + str
while len(str) < x:
	str = 'a' + str
print(str)

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

def name(n):
  if (n == 0):
    return "";
  n-=1
  return name(n//26) + chr(ord("a")+ n%26)
  
print(name(n))

Solution (Python):
def xxx(n):
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = chr(ord("a") + n%26) + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

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

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

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

def base_10_to_n(x, base):
  output = []
  while True:
    a = x % base
    output.append(a)
    x //= base
    if x == 0:
      for i in range(1, len(output)):
        if output[i-1] <= 0:
          output[i] = output[i] -1
      output = output[::-1]
      if output[0] == 0:
        output.pop(0)
      break
  return output

def base_10_from_n(x, base):
  output = 0
  for i in reversed(range(len(x)-1)):
    output += base ** i
  return output


base = 26
output = base_10_to_n(N, base)

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']
name = ''
for i in output:
  name += alphabet_list[i-1]
print(name)

Solution (Python):
n=int(input())
res=""
while n!=0:
    mod=(n-1)%26
    n=(n-1)//26
    res+=chr(97+mod)
print(res[::-1])

Solution (Python):
import math

def main():
    N = int(input())
    lowercase = 'abcdefghijklmnopqrstuvwxyz'
    ans = ''
    for i in range(len(str(N))):
        if N == 0:
            break
        j = N % 26
        N -= 1
        N = N // 26
        ans = lowercase[j-1] + ans
        
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):


N = int(input().strip())


ans = ""

while N > 0:
    digit_int = (N-1) % 26
    digit_str = chr( ord("a")  + digit_int )

    ans += digit_str
    N = (N-1) // 26

print(ans[::-1])

Solution (Python):
n=int(input())
from math import log, floor
dic = {}    
for v1,v2 in zip(range(26),'abcdefghijklmnopqrstuvwxyz'):
  dic[v1]=v2
ans = ''
for i in range(1,99):
  if n <= 26**i:
    n-=1
    for j in range(i):
      ans += dic[n%26]
      n //= 26
    break
  else:
    n -= 26**i

print(ans[::-1])

Solution (Python):
def main():
    N = int(input())
    ans = ""

    while N:
        N -= 1
        tmp = N % 26
        ans += chr(tmp + ord("a"))
        N //= 26

    print(ans[::-1])


if __name__ == '__main__':
    main()

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())
cher=[0]*26
ans_list=[]
flag=True

cher[0]='z'
count=1
for i in 'abcdefghijklmnopqrstuvwxy':
    cher[count]=i
    count+=1

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

Solution (Python):
N = int(input())
a = ord("a")
name_list = []

while N>0:
    name_list.append(chr(a+(N-1)%26))
    N = (N-1)//26

name_list.reverse()
print("".join(name_list))

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

i=0
compare_num = 26
flag = True
while(flag==True):
    if N > compare_num:
        N = N - compare_num
        i = i + 1
        compare_num = compare_num*26
    else:
        flag = False
        i = i + 1
        
tmp_str = []
if(i==1):
    tmp_str.append(chr(N+96))
else:
    for j in range(i-1):
        waru = 26**(i-(j+1))
        tmp_1 = int(N / waru)
        tmp_2 = N % waru
        if tmp_2 == 0:
            tmp_1 = int((N-1) / waru)
            tmp_2 = waru
        N = tmp_2
        tmp_str.append(chr(tmp_1+1+96))
    tmp_str.append(chr(tmp_2+96))
print(''.join(tmp_str))

Solution (Python):
n = int(input())
ans = ''
while n > 0:
    n, r = divmod(n-1, 26)
    ans = chr(r+ord('a')) + ans
print(ans)

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()

def f(k):
    return chr(97+k)

c = 0
i = 1
while True:
    d = c+pow(26,i)
    if c < n <= d:
        break
    c = d
    i+=1

m = n-c-1

ans = ''
while m >= 26:
    ans = f(m%26) + ans
    m = m//26
ans = f(m%26) + ans

ans = 'a'*(i-len(ans)) + ans

print(ans)

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):
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-1
    else:
      N-=B[i-1]+1
    for j in reversed(range(i+1)):
      if j>=1:
        name[i-j]=a[N//A[j-1]]
        N-=N//A[j-1]*A[j-1]
      else:
        name[i-j]=a[N]
    break

print(''.join(name))

Solution (Python):
import math
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())
alp = "abcdefghijklmnopqrstuvwxyz"
L = ""

for i in range(1,99):
    if N<=26**i:
        N -= 1
        for j in range(i):
            ind = int(N%26)
            L = alp[ind]+L
            N = (N-ind)/26
        break
    else:
        N -= 26**i
print(L)

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

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







MAX_DIGIT = 11

powers = (1, 26, 676, 17576, 456976, 11881376, 
          308915776, 8031810176, 208827064576, 
          5429503678976, 141167095653376 )



digits = (0, 1, 27, 703, 18279, 475255, 12356631, 321272407,
          8353082583, 217180147159, 5646683826135, 146813779479511
)

abc = ('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')

  




total_digit = 0
less_than_11 = False
for i in range(1, MAX_DIGIT + 1):
  if(N < digits[i]):
    less_than_11 = True
    total_digit = i - 1
    break

if not(less_than_11):
  total_digit = 11
  



name = [''] * (total_digit + 1)

for each_digit in range(total_digit, 0, -1):
  N -= 1
  num = N % 26
  N = N // 26
  name[each_digit] = abc[num]
  
  
  

print(''.join(name[1::]))

Solution (Python):
n = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
ans = []
while n>0:
    ans.append(al[n%26-1])
    n = (n-1)//26
print(*ans[::-1],sep="")

Solution (Python):
def xxx(n):
    alpha = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = alpha[n%26] + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

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

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

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

s = 26
cnt = 1
while 1:
    if N <= s:
        break
    cnt +=1
    s+=26**cnt


N = N-s+26**cnt-1
r = [0]*cnt
ans = [0]*cnt
for i in range(cnt):
    r[i] = N % 26
    N //= 26
    ans[i] = chr(ord("a")+r[i])
ans.reverse()
print("".join(ans))

Solution (Python):
N = int(input())
def translate(n):
    if n == 0:
        return "z"
    else:
        return (chr(n+96))
def solve(N):
    ans = ""
    while True:
        mod = N%26
        if mod == 0:
            N = N//26 - 1
        else:
            N = N//26
        if N == 0:
            ans = translate(mod) + ans
            return ans
            break
        else:
            ans = translate(mod) + ans
print(solve(N))

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

S = [chr(i) for i in range(ord("a"), ord("z")+1)]

l = []
while N > 0:
    N -= 1
    r = N % 26
    l.append(r)
    N //= 26

ans = ""
for a in l:
    ans = S[a] + ans

print(ans)

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue


Mod = 1000000007
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1] 
for i in range(2, 10**5 + 1):
    fact.append((fact[-1] * i) % Mod)
    inv.append((-inv[Mod % i] * (Mod // i)) % Mod)
    factinv.append((factinv[-1] * inv[-1]) % Mod)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p
    
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)
import string
def main():  
    n = int(input())
    ans = ""
    while n > 0:
        n -= 1
        ans += chr(ord("a") + n % 26)
        n //= 26
    print(ans[::-1])
if __name__ == "__main__":
    main()

Solution (Python):

import sys


def solve(N):
    N -= 1

    result = []
    while True:
        div = N // 26
        mod = N % 26

        result.append(mod)
        if div == 0:
            break
        N = div - 1
    result = result[::-1]
    result = [chr(x + ord('a')) for x in result]
    print(''.join(result))





def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def L(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())

alp = list("abcdefghijklmnopqrstuvwxyz")

def div26(N):
    
    a = N // 26
    b = N % 26
    
    return [a,b]

def getAlp(N):
    if N==0:
        N = 26
    return alp[N-1]

def solver(N):

    ans = ""

    x = div26(N)
    ans += getAlp(x[1])
    if x[1]==0:
        x[0] -= 1

    

    while x[0] > 0:
        
        x = div26(x[0])
        ans += getAlp(x[1])
        if x[1]==0:
            x[0] -= 1

    print(ans[::-1])




def main():
    N = I()
    
    solver(N)

if __name__ == '__main__':
    main()

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

S=[]

while N>0:
    N=N-1
    S.append(chr(N%26+97))
    N=N//26
S.reverse()

Z=[str(a) for a in S]
Z="".join(Z)
print(Z)

Solution (Python):
N = int(input())
alph = {}
p = 1
for i in range(97, 97+26):
    alph[str(p%26)] = chr(i)
    p += 1
k = 0
ans = []
while(N > 0):
    ans.append(alph[str(N % 26)])
    N = (N-1) // 26
print("".join(ans[::-1]))

Solution (Python):
def dec26(X, n):
    if (int(X/n)):
        return dec26(int(X/n)-1, n)+chr(X % n + 97)
    return chr(X % n + 97)


def main():
    n = int(input())
    x2 = dec26(n-1, 26)
    print(x2)


main()

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

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)
        
s = num2alpha(N)
print(str.lower(s))

Solution (Python):

import math
from sys import stdin
input = stdin.readline
import numpy as np


N = int(input())
al = [chr(i) for i in range(97, 97+26)]

ans = ""

while N>0:
    N -= 1
    ans += al[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):
n = int(input())

ans = ''

for i in range(1, 20):
    while n:
        n -= 1
        ans += chr(ord('a')+n%26)
        n //= 26

print(ans[::-1])

Solution (Python):
n = int(input())
ans = []
for i in range(1,99):
    if n>26**i:
        n-=26**i
    else:
        n-=1
        for j in range(i):
            ans.append(chr(ord('a')+n%26))
            n//=26
        break
print(*ans[::-1],sep="")

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

def num_to_str(num):
    return chr(num + 97)

ans = []
while N > 0:
    N -= 1
    q, r = divmod(N, 26)
    ans.append(r)
    N = q
ans_alpha = list(reversed([num_to_str(i) for i in ans]))
print(''.join(ans_alpha))

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

name = ''
while n > 0:
  n -= 1
  name += moji[(n%26)]
  n = n // 26


print(name[::-1])

Solution (Python):
import string

cs = string.ascii_lowercase
def factor(n):
    b = 26
    ds = [n % b]
    n //= b
    while n:
        d = n % b
        ds.append(d)
        n //= b
    return ds

n = int(input())
lst = [
26
,676
,17576
,456976
,11881376
,308915776
,8031810176
,208827064576
,5429503678976
,141167095653376
,3670344486987776
,95428956661682176
]
acc = [sum(lst[:i]) for i in range(len(lst))]
for i, (an1, an) in enumerate(zip(acc, acc[1:]), 1):
    if n < an + 1:
        pos = n - an1 - 1
        fp = factor(pos)
        while len(fp) < i:
            fp.append(0)
        fp.reverse()

        print(''.join(cs[d] for d in fp))
        break

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

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

print(c_one_quadrillion_and_one_dalmatians())

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())

    abc = [chr(i) for i in range(ord("a"),ord("z")+1)]

    x=1
    y=0
    keta=0
    s=0
    while 1:
        x*=26
        y+=x
        keta+=1
        if n <= y:
            s=y-x+1
            break
    to=n-s
    ans=""
    for i in range(keta):
        ans=abc[to%26]+ans
        to=to//26

    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Solution (Python):


import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N = int(input())
    s = "abcdefghijklmnopqrstuvwxyz"
    ans = ""

    a = N
    while a:
        a -= 1
        a, b = divmod(a, 26)
        ans = s[b] + ans

    print(ans)

if __name__ == "__main__":
    resolve()

Solution (Python):
N=int(input())
lista=["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"]
amari=[]
ans=""
while N!=0:
    (x,y)=divmod(N,26)
    amari.append(y)
    N=x
amari=amari[::-1]
while 0 in amari[1:]:
    for i in range(len(amari)-1):
        if amari[i+1]==0:
            amari[i]-=1
            amari[i+1]=26
if amari[0]==0:
    amari.pop(0)
for i in amari:
    ans+=lista[i-1]
print(ans)

Solution (Python):
n = int(input())
ans = ''
while n > 0:
    n, r = divmod(n-1, 26)
    ans = chr(r+ord('a')) + ans
print(ans)

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

Solution (Python):
n = int(input())
name = ''
l = 0
for i in range(1,99):
    if n - 26**i <= 0:
        l = i
        break
    else:
        n -= 26**i
n -= 1
for j in range(l):
    name = chr(ord('a') + n%26) + name
    n = n//26
print(name)

Solution (Python):

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

Solution (Python):
n = int(input())
s = []
while n!=0:
    if n<=26:
        s.append(n)
        n = 0
    else:
        x = n % 26
        
        if not x:
            x = 26
        s.append(x)
        n = (n - 1) // 26
t = []

for i in range(len(s)-1,-1,-1):
    t.append(chr(s[i]+96))
print(''.join(t))

Solution (Python):
import string
N = int(input())
alphabet = list(string.ascii_lowercase)

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

ans = ''
for i in idxs[::-1]:
    ans += alphabet[i]
print(ans)

Solution (Python):
n=int(input())
ans=[]
data=["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>0):
    n-=1
    ans.append(n%26)
    n=n//26
for i in range(len(ans)-1,-1,-1):
    print(data[ans[i]],end="")

Solution (Python):
def solve():
    n = int(input())
    a = 97
    tmp = 0
    index = 0
    ans = []
    for i in range(1, 12):
        pre = tmp
        tmp += 26 ** i
        if n <= tmp:
            index = i
            n = n - pre
            break
    n = n - 1
    for _ in range(0, index)[::-1]:
        ans.append(chr((n % 26) + a))
        n = n // 26
    print(''.join(ans[::-1]))








if __name__ == '__main__':
    solve()

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

resolve()

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

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')







def solve():
    N = II()
    
    
    

    abc = [chr(i) for i in range(ord('a'), ord('z') + 1)]
    ans = []
    while N != 0:
        N -= 1
        ans.append(abc[N % 26])
        N //= 26
    printlist(ans[::-1], '')


if __name__ == '__main__':
    solve()

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

Solution (Python):
n = int(input())
alpha_arr = [chr(i) for i in range(97, 97+26)]
ans = []
while n > 0:
    n -= 1
    ans.insert(0, alpha_arr[n % 26])
    n //= 26
print(''.join(ans))

Solution (Python):
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num)
    if amari == 0:
        amari = 122
        N=int(N/num)-1
    else:
        amari += 96
        N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if N / num == 0:
        break

for l in name:
    S = S + l
print(str(S))

Solution (Python):
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
ans=[]
while num > 0:
  ans.append(alpha[num%26-1])
  num//=26
  if ans[-1]=='z':
    num-=1
print(''.join(ans[::-1]))

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

while True:
    N -= 1
    q, mod = divmod(N, 26)
    ans = komoji[mod] + ans
    
    if q == 0:
        break
    N = q
print(ans)