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 string
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


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


n = I()
m = 1
i = 0

print(n_to_alp(n).lower())

Solution (Python):
N=int(input())
out=''
while N>26:
    if N%26!=0:
        out=str(chr(ord('a')+N%26-1))+out
        N=N//26
    else:
        out=str(chr(ord('a')+25))+out
        N=N//26-1
if N!=0:
    print(str(chr(ord('a')+N-1))+out)
else:
    print(out)

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

arr = []

while n:
    arr.append(n % 26)
    n = n // 26

for i in range(len(arr) - 1):
    if arr[i] <= 0:
        arr[i] += 26
        arr[i + 1] -= 1



name = ""
for i in arr[::-1]:
    if i > 0:
        name = name + chr(96+i)
print(name)

Solution (Python):
n=int(input())
x=26
l=["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"]
r=[]
while n > 0:
    r.append(l[n%x-1])
    n=int((n-1)/x)
r=r[::-1]
print("".join(r))

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):
import sys
input = sys.stdin.readline


N = int(input())
alpha = 'zabcdefghijklmnopqrstuvwxy'


def dogname(n, udn=''):
    rem = n % 26
    dn = udn + alpha[rem]
    quo = n // 26 if rem != 0 else (n - 1) // 26
    if quo == 0:
        return dn[::-1]
    else:
        return dogname(quo, dn)


print(dogname(N))

Solution (Python):
import math
p=int(input())
ll=["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=0
n=0
prevn=0

while n<1000000000000001:
  a+=1
  prevn=n
  n+=26**a
  if n>=p:
    break
    
p2=p-prevn-1

al=""
for i in range(a):
  s1=math.floor(p2/(26**(a-i-1)))
  al=al+ll[s1]
  p2=p2%26**(a-i-1)

print(al)

Solution (Python):


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)

def main():
    print(num2alpha(int(input())))

if __name__ == '__main__':
    main()

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

    A = 'zabcdefghijklmnopqrstuvwxyz'
    ans = ''
    while n > 0:
        ans = A[n % 26] + ans
        if(n % 26 == 0):
            n = n // 26 - 1
        else:
            n = n // 26

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
A = "abcdefghijklmnopqrstuvwxyz"

def solve(X, n):
    q, r = divmod(X, 26)
    if q == 0:
        return A[r]
    return solve(q - 1, n) + A[r]

N = int(input()) - 1
print(solve(N, 26))

Solution (Python):
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
n=N()
ans=[]
while n>0:
    n-=1
    x=n%26
    ans.append(chr(x+97))
    n//=26
ans.reverse()
print("".join(ans))

Solution (Python):
n = int(input()) - 1
x = 26
i = 1
while n >= x:
  n -= x
  x *= 26
  i += 1
r = ''
while n:
  r = chr(97 + n % 26) + r
  n //= 26
print(r.rjust(i, 'a'))

Solution (Python):
import sys
def S(): 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())
INF = 1000000000000

n = I()
s = "abcdefghijklmnopqrstuvwxyz"

val = [-1]*100

i = 0
tmp = n - 1
while(True):
    val[i] = tmp % 26
    tmp = tmp // 26
    tmp = tmp - 1
    i += 1
    if(tmp < 0):
        break

result = ''
i = 0
while(val[i] >= 0):
    if(i == 0):
        result += s[val[i]]
    else:
        result += s[val[i]]
    i += 1

result = result[::-1]
print(result)

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


buf = []
while True:
    
    if n >= 26:
        tp = n%26
        if tp == 0:
            buf.append(tp)
            n = n // 26-1
            if n == 0:
                break
        else:
            buf.append(tp)
            n = n // 26

    else:
        buf.append(n)
        break

buf.reverse()


ans = ""
for b in buf:
    if b == 0:
        ans += chr(26 + 96)
    else:
        ans += chr(b+96)
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)

if __name__=='__main__':
    num = int(input())
    num2=num2alpha(num)
    print(num2.lower())

Solution (Python):
import string

def resolve():
    N = int(input())
    tmp = N
    name = ""
    
    for i in range(13):
        div, mod = divmod(tmp - 1, 26)
        name = string.ascii_lowercase[mod] + name
        if div == 0:
            print(name)
            return
        tmp = div

resolve()

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

def baseto26(num):

    if num <= 0:
        return ""
    elif num <= 26:
        return chr(96+num)
    else:
        return baseto26(int((num-1)/26))+chr(97+(num-1)%26)
print(baseto26(n))

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

abc='abcdefghijklmnopqrstuvwxyz'

n=int(input())

ans=''
while n!=0:
  t_ans=n%26
  ans+=str(abc[t_ans-1])

  if abc[t_ans-1]=='z':
    n-=1

  n//=26



print(ans[::-1])

Solution (Python):
n = int(input())
q =[0]*100
a = 0
for i in range (100):
  if(n <=26):
    a = i
    q[i] = n
    break
  q[i] = n%26
  if(q[i]==0):
    q[i]=26
    n = n//26-1
  else:
    n = n//26
for i in range(a,-1,-1):
  print(chr(96+q[i]),end='')

Solution (Python):
N=int(input())
s=""
while(N>0):
	c=N%26
	N=N//26
	if c==0:
		N-=1
	if c!=0:
		s=chr(96+c)+s
	else:
		s=chr(96+26)+s
print(s)

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

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

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

coe = []
while True:
    q, mod = divmod(N - 1, 26)
    coe.insert(0, mod)
    if q == 0:
        break
    N = q
ans = ""
for i in coe:
    ans += alp[i]
print(ans)

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

Solution (Python):
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n)-1, n)+str(chr(ord('a')+X%n))
    return str(chr(ord('a')+X%n))

x10 = int(input())
x26 = Base_10_to_n(x10-1, 26)
print(x26)

Solution (Python):
n=int(input())
al=[chr(97+ i) for i in range(26)]
def f(n):
    ans=""
    while n>0:
        ans+=str(al[n%26-1])
        
        if n%26==0:
            n//=26
            n-=1
        else:n//=26    
    return ans[::-1]
print(f(n))

Solution (Python):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 


def Base_10_to_n(X, n):
    out = []
    X_dumy = X
    t = X_dumy%n
    out = [chr(t + ord('a'))]
    X_dumy = int(X_dumy/n)
    while X_dumy>0:
        X_dumy -= 1
        t = X_dumy%n
        out.append(chr(t + ord('a')))
        X_dumy = int(X_dumy/n)
    return out

n = int(input()) - 1

ans = Base_10_to_n(n, 26)
for i in range(len(ans)-1, -1, -1):
    print(ans[i], end='')
print()

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

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


ans = []

while True:
    ans.append(l[int(N%26) -1])
    
    if N <= 26:
        break
    if not N%26:
        N -= 1
        N = int(N//26)
    else:
        N = int(N//26)



ans.reverse()
print("".join(ans))

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

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

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

num2alpha = lambda c: chr(c+96)

ans = ""

while True:
    a = n % 26
     
    if n < 1:
        break
    
    
    if a == 0:
        a = 26

    n = int((n - a)  / 26)

    ans += num2alpha(int(a))
    
print(ans[::-1])

Solution (Python):
N = int(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
al = [26 for _ in range(50)]
for i in range(49):
    al[i+1] = 26 * al[i]
for i in range(49):
    al[i+1] += al[i]
bl = [1 for _ in range(50)]
for i in range(49):
    bl[i+1] = 26 * bl[i]
def f(n):
    if 0 <= n and n <= 25:
        return alpha[n]
    cnt = 1
    while al[cnt-1] <= n:
        cnt += 1
    nn = n - al[cnt-2]
    s = ""
    for i in range(cnt):
        s = alpha[nn % 26] + s[:]
        nn //= 26
    return s
    
print(f(N-1))

Solution (Python):
n = int(input())
 
code = ""
while n>0:
  c = n%26
  if c == 0:
    c = 26
  code = chr(ord("a")+c-1) + code
  n = (n-c) // 26
  
print(code)

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
from decimal import Decimal

def main():

    input = stdin.readline

    N = int(input())

    alphabet = "abcdefghijklmnopqrstuvwxyz"

    ans = ""
    flag = True
    while flag:
        if N <= 26:
            flag = False

        ans = alphabet[(N-1)%26] + ans

        N = (N-1) // 26

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
ans = []
while N != 0:
    k = N % 26
    if k == 0:
        k += 26
    ans.append(chr(96 + k))
    N -= k
    N //= 26

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

Solution (Python):
n = int(input())
c = 2
tmp = 26
b4 = 0
while(n > tmp):
  b4 = tmp
  tmp = tmp + (26 ** c)
  c+=1


ans = ""
tt = n-b4-1
mod = 26**(c-1)
for i in range(c):
  ans += chr(97+int(tt/mod))
  tt -= int(tt/mod)*mod
  mod = mod//26
print(ans[1:])

Solution (Python):
N = int(input())
name = ""
alphabet = "abcdefghijklmnopqrstuvwxyz"
while N > 0:
    a = (N - 1) // 26
    b = (N - 1) % 26
    name += alphabet[b]
    N = a

print(name[::-1])

Solution (Python):
import numpy as np

CHAR = "abcdefghijklmnopqrstuvwxyz"

N = int(input()) - 1
s = ""

while(True):
    b = N % 26
    N = N // 26
    s = CHAR[b] + s
    if(N == 0):
        print(s)
        break
    N -= 1

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

l = ['z','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']

j = []

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

print(''.join(j))

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())
alpha = "abcdefghijklmnopqrstuvwxyz"
tmp = [26 ** i for i in range(1, 20)]
lst = [0]
for num in tmp:
    lst.append(lst[-1] + num)
for i, num in enumerate(lst):
    if num >= n:
        p = i
        break
ans = list("a" * p)
n -= lst[p - 1] + 1
for i in range(p - 1, -1, -1):
    if n == 0:
        break
    pos = n % 26
    n //= 26
    ans[i] = alpha[pos]
print("".join(ans))

Solution (Python):
N = int(input())
if N <= 26:
    print(chr(ord('a') - 1 + N))
else:
    N -= 1
    d = [N % 26]
    N //= 26
    while N:
        N -= 1
        d.append(N % 26)
        N //= 26
    d.reverse()
    ans = chr(ord('a') + d[0])
    for i in range(1, len(d)):
        ans += chr(ord('a') + d[i])
    print(ans)

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input()) - 1
    res = []
    while 1:
        res.append(chr(ord('a') + n % 26))
        n = n // 26 - 1
        if n == -1:
            break

    res.reverse()
    print(''.join(res))
resolve()

Solution (Python):

abclist = list('abcdefghijklmnopqrstuvwxyz')

N = int(input())


vals = []
strs = []
while(N != 0):
    N = N - 1

    mod = N % 26

    N = N // 26

    vals.append(mod)

    strs.append(abclist[mod])

strs.reverse()
s = "".join(strs)
print(s)

Solution (Python):
cha='abcdefghijklmnopqrstuvwxyz'
dig=[]
N=int(input())
d=0
n=0
ls=[]
while n<=N:
  n+=(26**d)
  ls.append(n)
  d+=1

N-=n
n=N
for _ in range(d-1):
  dig.append(n%26)
  n//=26
ans=[]
for i in range(len(dig)):
  ans.append(cha[dig[i]])
ans.reverse()
print(*ans,sep='')

Solution (Python):
n = int(input())
s = []
while n > 0:
  s.append(chr((n-1) % 26 + 97))
  n = (n-1) // 26
print(''.join(list(reversed(s))))

Solution (Python):
N = int(input())
x = [26**i for i in range(1, 12)]
sumx = [sum(x[:i]) for i in range(1, 12)]
abc = 'abcdefghijklmnopqrstuvwxyz'
keta = 1

for i in range(0, 11):
    if N > sumx[i]:
        keta += 1

if keta > 1:
    N = N - sumx[keta-2] - 1
else:
    N = N - 1

out = ''
for i in range(keta):
    out = abc[N%26] + out
    N = int(N/26)
    
print(out)

Solution (Python):
al = ["Q"] + [chr(ord('a') + i) for i in range(26)]
n = int(input())
s = ""
while n:
    if n % 26:
        a = n % 26
        n //= 26
    else:
        a = 26
        n //= 26
        n -= 1
    s += al[a]
print(s[::-1])

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

alphabet = "0abcdefghijklmnopqrstuvwxyz"
name = []
if N == 0:
    print("a")
    sys.exit()

while N > 0:
    if N % 26 == 0:
        next = 26
    else:
        next = N % 26
    name += alphabet[next]
    N = (N - next) // 26
name.reverse()
print("".join(name))

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

def Base_10_to_n(X, n):
    X = X-1
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    if (int((X)/n)):
        return Base_10_to_n(int(X/n), n)+alphabet[X%n]
    return alphabet[X%n]
print(Base_10_to_n(X, 26))

Solution (Python):
n = int(input())
ans = ''
while n>0:
    ama = n%26
    if ama==0:
        ama=26
    ans = chr(96+ama) + ans
    n = (n-ama)//26
 
print(ans)

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

ans = ""
lis = []
while n>0:
    n-=1
    lis.append(chr(97+n%26))
    n //= 26
for i in range(len(lis)):
    ans += lis[len(lis)-i-1]
print(ans)

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

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


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
lis = []
while n != 0:
    if n%26 == 0:
        lis.append(int(0))
        n -= 26
        n /= 26
    else:
        lis.append(int(n%26))
        n -= n%26
        n /= 26
alp = ["z","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"]
st = ""
for i in range(len(lis),0,-1):
    st += alp[lis[i-1]]
print(st)

Solution (Python):
N = int(input())
digit = 1
for i in range(1,11):
    if N > 26**i:
        digit += 1
        N -= 26**i
    else:
        break
ans = []
for i in reversed(range(1,digit)):
    ans.append((N-1)//(26**i))
    N -= ans[-1]*(26**i)
ans.append(N-1)
ans = [chr(i+97) for i in ans]
print("".join(ans))

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

Alphabet = "abcdefghijklmnopqrstuvwxyz"

ans = ""

while N:
  N -= 1
  ind = N%26
  ans = Alphabet[ind] + ans
  N = N//26

print(ans)

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

N = int(input())

piv = 0
while True:
    if 26*(26**piv-1)/25 >= N:
        break
    piv += 1
N -= 26*(26**(piv-1)-1)/25 + 1
for i in reversed(range(piv)):
    x = int(N//(26**i)%26)
    print(chr(x+97), end='')
print()

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

result = ""

while(n != 0):
  if (n % 26 == 0):
    result = "z" + result
    n = n // 26 - 1
  else:
    result = chr(ord("a") + (n % 26) - 1) + result
    n //= 26

print(result)

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

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

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

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

ans = []
while n > 26:
    if n % 26 == 0:
        ans.append(26)
        n = n // 26 - 1
    else:
        ans.append(n % 26)
        n = n // 26
ans.append(n)
ans.reverse()
for i in ans:
    print(chr(i+96), end="")
print("")

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

print(alphabet_decimal(n))

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

name = []

while (N > 0):
    N = N-1
    i = N % 26
    name.append(chr(ord("a")+(i) % 26))
    N = N // 26


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

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

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

Solution (Python):
al = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
N = int(input())
tmp = 26
ans = ''
while True:
    ans += al[N%26-1]
    if N <= 26:
        break
    if N % 26 == 0:
        N = (N//tmp)-1
    else:
        N = N // tmp
print(ans[::-1])

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

ls=list("abcdefghijklmnopqrstuvwxyz")

if N<=26:
	print(ls[N-1])
elif N<=702:
	M=N-26-1
	ans1=M//26**1
	ans2=M%26**1
	print(ls[ans1]+ls[ans2])
elif N<=18278:
	M=N-702-1
	ans1=M//26**2
	M=M%26**2
	ans2=M//26**1
	M=M%26**1
	ans3=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3])
elif N<=475254:
	M=N-18278-1
	ans1=M//26**3
	M=M%26**3
	ans2=M//26**2
	M=M%26**2
	ans3=M//26**1
	M=M%26**1
	ans4=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4])
elif N<=12356630:
	M=N-475254-1
	ans1=M//26**4
	M=M%26**4
	ans2=M//26**3
	M=M%26**3
	ans3=M//26**2
	M=M%26**2
	ans4=M//26**1
	M=M%26**1
	ans5=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5])
elif N<=321272406:
	M=N-12356630-1
	ans1=M//26**5
	M=M%26**5
	ans2=M//26**4
	M=M%26**4
	ans3=M//26**3
	M=M%26**3
	ans4=M//26**2
	M=M%26**2
	ans5=M//26**1
	M=M%26**1
	ans6=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6])
elif N<=8353082582:
	M=N-321272406-1
	ans1=M//26**6
	M=M%26**6
	ans2=M//26**5
	M=M%26**5
	ans3=M//26**4
	M=M%26**4
	ans4=M//26**3
	M=M%26**3
	ans5=M//26**2
	M=M%26**2
	ans6=M//26**1
	M=M%26**1
	ans7=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6]+ls[ans7])
elif N<=217180147158:
	M=N-8353082582-1
	ans1=M//26**7
	M=M%26**7
	ans2=M//26**6
	M=M%26**6
	ans3=M//26**5
	M=M%26**5
	ans4=M//26**4
	M=M%26**4
	ans5=M//26**3
	M=M%26**3
	ans6=M//26**2
	M=M%26**2
	ans7=M//26**1
	M=M%26**1
	ans8=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6]+ls[ans7]+ls[ans8])
elif N<=5646683826134:
	M=N-217180147158-1
	ans1=M//26**8
	M=M%26**8
	ans2=M//26**7
	M=M%26**7
	ans3=M//26**6
	M=M%26**6
	ans4=M//26**5
	M=M%26**5
	ans5=M//26**4
	M=M%26**4
	ans6=M//26**3
	M=M%26**3
	ans7=M//26**2
	M=M%26**2
	ans8=M//26**1
	M=M%26**1
	ans9=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6]+ls[ans7]+ls[ans8]+ls[ans9])
elif N<=146813779479510:
	M=N-5646683826134-1
	ans1=M//26**9
	M=M%26**9
	ans2=M//26**8
	M=M%26**8
	ans3=M//26**7
	M=M%26**7
	ans4=M//26**6
	M=M%26**6
	ans5=M//26**5
	M=M%26**5
	ans6=M//26**4
	M=M%26**4
	ans7=M//26**3
	M=M%26**3
	ans8=M//26**2
	M=M%26**2
	ans9=M//26**1
	M=M%26**1
	ans10=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6]+ls[ans7]+ls[ans8]+ls[ans9]+ls[ans10])
else:
	M=N-146813779479510-1
	ans1=M//26**10
	M=M%26**10
	ans2=M//26**9
	M=M%26**9
	ans3=M//26**8
	M=M%26**8
	ans4=M//26**7
	M=M%26**7
	ans5=M//26**6
	M=M%26**6
	ans6=M//26**5
	M=M%26**5
	ans7=M//26**4
	M=M%26**4
	ans8=M//26**3
	M=M%26**3
	ans9=M//26**2
	M=M%26**2
	ans10=M//26**1
	M=M%26**1
	ans11=M//26**0
	print(ls[ans1]+ls[ans2]+ls[ans3]+ls[ans4]+ls[ans5]+ls[ans6]+ls[ans7]+ls[ans8]+ls[ans9]+ls[ans10]+ls[ans11])

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy>0:
        n_out = [X_dumy%n]
        n_out.extend(out)
        out = deepcopy(n_out)
        X_dumy = int(X_dumy/n)
    return out

n = INT()
m = Base_10_to_n(n, 26)

m = [i - 1 for i in m]

for i in reversed(range(1, len(m))):
    if m[i] < 0:
        m[i] += 26
        m[i - 1] -= 1

strt = 0
for i in range(len(m)):
    if m[i] < 0:
        strt = i + 1
    else:
        break
ans = ''
for i in m[strt:]:
    ans += chr(ord('a') + i)
print(ans)

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

while(n!=0):
    a=n%26
    n=n//26
    if(a==0):n-=1
    ans+=s[a-1]
print(ans[::-1])

Solution (Python):
n = int(input())
res = ""
while n:
    n -= 1
    n, y = divmod(n, 26)
    res = chr(y + 97) + res
print(res)

Solution (Python):
n = int(input())
i = 1
while (n-26**i) > 0:
    n -= 26**i
    i += 1

ans = [0]*(i)

n -= 1
for j in range(1,i+1):
    t = n%26
    n -= t
    n = n//26
    ans[j-1] = t

a = ""
for i in range(i-1,-1,-1):
    a += chr(97+ans[i])
print(a)

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

char = string.ascii_lowercase
rev = {c: i for i,c in enumerate(char, start=1)}

name_rev = []

while 1:
    
    M = N % 26
    name_rev.append(char[M -1])
    if N <= 26:
        break
    N = (N-1) // 26
print("".join(name_rev[::-1]))

Solution (Python):
n = int(input())
cp = 26
pcp = 0
cl = 1
while n > cp:
    pcp = cp
    cl += 1
    cp += 26**cl

n -= pcp + 1
cp = 1
ans = ''
for i in range(cl):
    t = (n % (cp * 26) - n % cp) // cp
    t = max(t, 0)
    ans = chr(t + 97) + ans
    n -= t*cp
    cp *= 26
print(ans)

Solution (Python):

M = int(input())
s=''
a=['z','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']
while M>0:
    s+=a[M%26]
    if M%26==0:
        M=int((M-1)/26)
    else:
        M=int(M/26)
print(s[::-1])

Solution (Python):
N = int(input())
chars = "abcdefghijklmnopqrstuvwxyz"
result = []

while N != 0:
    temp = N % 26

    result.append(chars[temp - 1])
    if temp == 0:
        N = N // 26 - 1
    else:
        N = N // 26

print("".join(reversed(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)

ans=num2alpha(n).lower()
print(ans)

Solution (Python):
n= int(input())
ans= ''
trans= {}
for x in range(1, 27):
	trans[x]= chr(x+96)

while n!=0:
	if n%26==0:
		ans= 'z'+ ans
		n= n//26-1
	else:
		ans= trans[n%26] + ans
		n= n//26
print(ans)

Solution (Python):
n=int(input())
A="zabcdefghijklmnopqrstuvwxy"

Z=[0]
for i in range(11):
    Z.append(Z[-1]+26**(i+1))

    
q=26
C=[]
while n>0:
    if n in Z:
        for i in range(Z.index(n)):
            C.append(0)
        break
    r=n%q
    C.append(r)
    if r==0:
        n-=q
    n//=q
C=list(reversed(C))
ans=""
for c in C:
    ans+=A[c]
print(ans)

Solution (Python):
n = int(input())
ans = []
keta = n//26
while n != 0:
    i = n%26
    if i == 0:
        o = 'z'
        n = n//26 -1
    else:
        o = chr(n%26 +96)
        n //= 26
    ans.append(o)
ans = reversed(ans)
print(''.join(ans))

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

digit = 26

ans = ''
while N > 0:
    num = N % digit
    if num == 0:
        num = digit
    N -= num
    num /= (digit/26)
    num += 96
    ans += chr(int(num))
    digit *= 26
    
print(ans[::-1])

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

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

def naming(N):
    if(N == 0):
        name.reverse()
        print(''.join(name))
    else:
        a = N // 26
        b = N % 26
        if(b == 0):
            b = 26
            a -= 1
        name.append(alphabet[b-1])

        naming(a)

naming(N)

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

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

Solution (Python):

"""
Created on Sun Jun 21 21:03:27 2020

@author: NEC-PCuser
"""

N = int(input())

c = ""

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

a = 1
b = 1
while a <= N:
    moji_up_list.append(a)
    b *= 26
    a += b
    
N -= moji_up_list[len(moji_up_list) - 1]

j = 26 ** (len(moji_up_list) - 1)
for i in range(len(moji_up_list)):
    c += alpha_list[N // j]
    N = N % j
    j = j // 26

print(c)

Solution (Python):
n=int(input())-1
d=12
az=26
a=[]
b=[]
b0=0
for ii in range(d):
  a0=az**(ii+1)
  a.append(a0)
  b0+=a0
  b.append(b0)
for ii in range(d):
  if n<b[ii]:
    break
i0=b[ii]-a[ii]
n=n-i0

def func(ii,n):
  r=[]
  for jj in range(ii+1):
    azjj=az**(ii-jj)
    c=n//azjj
    r.append(chr(ord("a")+c))
    n=n%azjj
  return r
             
print("".join(func(ii,n)))

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

n = int(input())
print(num2alpha(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)

print(num2alpha(N).lower())

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)

output = num2alpha(n)
print(output.lower())

Solution (Python):
import re
def main():
    n = int(input())
    ans = []
    while n // 26 > 0:
        ans.append(chr(97 + (n-1)%26))
        n = (n - 1) // 26
    if n > 0:
        ans.append(chr(97 + (n-1)%26))

    ans.reverse()
    print("".join(ans))
    return 

if __name__ == "__main__":
    main()

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

while N >= 26:
    m = N % 26
    if m == 0:
        ans = chr(96 + 26) + ans
        N //= 26
        N -= 1
    else:
        ans = chr(96 + m) + ans
        N //= 26

if N == 0:
    print(ans)
else:
    print(chr(96 + N) + ans)

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

count = 0
N_copy = N
while N_copy != 0:
    N_copy //= 26
    count += 1

ans = ""
alpha = "abcdefghijklmnopqrstuvwxyz"
for i in range(count):
    
    ans = alpha[N%26-1] + ans
    if N%26 == 0:
        N //= 26
        N -= 1
    else:
        N //= 26

if ans[0] == "z":
    print(ans[1:len(ans)])
else:
    print(ans)

Solution (Python):
import math

N = int(input())

n = math.log((1 - (N * (1 - 26) // 26)), 26)

n = math.ceil(n)

S = 26 * (1 - 26 ** (n - 1)) // (1 - 26)

M = N - S - 1


res = ''

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"]

for i in range(n):
    index = i + 1

    s = M % (26 ** index)

    t = s // (26 ** i)

    res = arr[t] + res

    M -= s

print(res)