Problem:
 Score : 300 points    Problem Statement 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001 , but he gave them new names, as follows:   the dogs numbered 1,2,\cdots,26 were respectively given the names a , b , ..., z ;  the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names aa , ab , ac , ..., zy , zz ;  the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names aaa , aab , aac , ..., zzy , zzz ;  the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names aaaa , aaab , aaac , ..., zzzy , zzzz ;  the dogs numbered 475255,475256,\cdots were respectively given the names aaaaa , aaaab , ...;  and so on.   To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names:  a , b , ..., z , aa , ab , ..., az , ba , bb , ..., bz , ..., za , zb , ..., zz , aaa , aab , ..., aaz , aba , abb , ..., abz , ..., zzz , aaaa , ...  Now, Roger asks you:  "What is the name for the dog numbered N ?"      Constraints  N is an integer.  1 \leq N \leq 1000000000000001         Input Input is given from Standard Input in the following format:  N       Output Print the answer to Roger's question as a string consisting of lowercase English letters.        Sample Input 1 2      Sample Output 1 b       Sample Input 2 27      Sample Output 2 aa       Sample Input 3 123456789      Sample Output 3 jjddja

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

N = int(input())
i = 0
lis = []
while True:
    if N % 26 == 0:
        lis.append(26)
        N -= 26
        
    else:
        lis.append(N%26)
    N = N//26
    if N == 0:
        break
    
for i in range(len(lis)-1,-1,-1):
    print(chr(lis[i]+96),end = "")

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

for i in range(1, 100):
    if N<=26**i:
        ans = ''
        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())
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())
import math

num2alpha = lambda c: chr(c)
tmp_N = N
result = ''
while (tmp_N / 26) > 1.0:
    k = int(tmp_N / 26)
    res = tmp_N % 26
    if res == 0:
        res = 26
        k -= 1
    result += num2alpha(res+64).lower()
    tmp_N = k
res = tmp_N % 26
if res == 0:
    res = 26
    k -= 1
result += num2alpha(res+64).lower()
new_str = ''.join(list(reversed(result)))
print(new_str)

Solution (Python):
n=int(input())
ans=[]
b=["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=0
keta=0
for i in range(100):
    if num >= n:
        keta = i
        break
    num = 26**(i+1)+num
num  = num - 26**keta
n = n - num -1 
for i in range(keta):
    ans.append(b[n%26])
    n=n//26
ans.reverse()
print(''.join(ans))

Solution (Python):
import math

n = int(input())
aaa = [chr(i) for i in range(97, 97+26)]
ans =''

while n >= 1:
    ans = aaa[(n % 26) - 1] + ans
    n = math.ceil(n / 26) - 1
print(ans)

Solution (Python):
N = int(input())
alpha ='abcdefghijklmnopqrstuvwxyz'
keta = 1
judge = 26

while True:
    if N<=judge:
        break
    else:
        judge = judge + 26**(keta+1)
        keta += 1
M = N - (judge-26**keta)-1
answer = ''
import copy
ket = copy.copy(keta)

for i in range(keta):
    num = M//(26**(ket-1))
    amari = M%(26**(ket-1))
    
    answer += alpha[num]
    ket -= 1
    M = amari
print(answer)

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

name = ""

def num2char(n) :
  if n == 0:
    n = 26
  return chr(n+96)

while(N > 26) :
  m = N%26
  name = num2char(m) + name
  N = int(N/26)
  if m == 0 :
    N -= 1
  
name = num2char(N) + name
print(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):
answer = ""
num = int(input())
j = 0
while(num > 0):
    j = num % 26
    num = num // 26
    if j == 0:
        answer += 'z'
        num -= 1
    else:
        answer += chr(96+j)

print(answer[::-1])

Solution (Python):

def get_char(x):
    return chr(ord('a') + x)


def submit():
    n = int(input())
    n -= 1

    ans = []
    while True:
        r, q = divmod(n, 26)
        c = get_char(q)
        ans.append(c)
        if r == 0:
            break
        n -= q
        n //= 26
        n -= 1
    
    print("".join(reversed(ans)))
    

submit()

Solution (Python):
n = int(input())
T =[]
S = ""
while n>0:
  if n%26==0:
    T.insert(0, 26)
    n = n//26 -1 
  else:
    T.insert(0, n%26)
    n = n//26
for t in T:
  S += chr(t+96)
print(S)

Solution (Python):
n = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(1, 12):
    if n <= 26 ** i:
        n -= 1
        for _ in range(i):
            ans += alphabet[n % 26]
            n //= 26
        break
    else:
        n -= 26 ** i
print(ans[::-1])

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

res = ""


d = 26


while N :
    N-=1
    c = N% 26
    res += chr(97+c)
    N //=26

print(res[::-1])

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

Solution (Python):
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

INF = 10**18
eps = 10**-7

N = int(readline())
digit = 26
now = 26
c = 1
while now < N:
    digit *= 26
    now += digit
    c += 1
now = now - digit
N = N - now -1
ans = ''
for i in range(c):
    ans += chr(97+N%26)
    N //= 26

print(ans[::-1])

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

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

while N > 0:
    N -= 1
    name += alfa[N % 26]
    N //= 26

print(name[::-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())
namelist=[]
name=''
while n>0:
  n-=1
  namelist.append(chr(ord('a')+n%26))
  n=int(n/26)
for i in namelist[::-1]:
  name+=i
print(name)

Solution (Python):
n=int(input())
 
cnt=0
tmp=0
 
while n>tmp:
    cnt+=1
    tmp+=26**cnt
 
num=n-(tmp//26)

ans=["0"]*cnt

for i in range(1, cnt+1):
    j=num%26
    num//=26
    add=chr(ord("a")+j)
    ans[-i]=add

print(*ans, sep='')

Solution (Python):
N = int(input())
ans = ''
for i in range(1, 10000):


    if N <= 26 ** i: 

        N += -1
        for j in range(i):


            ans += chr(ord('a') + N % 26)
            N = N // 26  
        break
    else:
        N -= 26 ** i

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

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

while n != 0:
    cnt.append(n%26)
    n = n//26

for i in range(0, len(cnt)-1):
    if cnt[i] <= 0:
        cnt[i] += 26
        cnt[i+1] -= 1
cnt.reverse()
if cnt[0] == 0:
    del cnt[0]

ans = ""
for i in cnt:
    ans += name[i-1]

print(ans)

Solution (Python):
N=int(input())
keta=0
n=N
ketakari=0
while(1):
    keta+=1
    ketakari+=26**keta
    if N<=ketakari:
        break
for j in range(1,keta):
    N-=26**j
ans=""



N-=1
for i in range(keta):
    kari=N%26
    ans=chr(ord("a")+kari)+ans
    N//=26
print(ans)

Solution (Python):
x = int(input())
ans = []
while x>0:
	tmp = x%26
	ans.append(tmp)
	if tmp==0:
		x -= 26
	else:
		x -= tmp
	x //= 26

l = len(ans)
for i in range(l-1):
	if ans[l-i-1]==0:
		print('z',end="")
	else:
		print(chr(ord('a')+ans[l-i-1]-1),end="")

if ans[0]==0:
	print('z')
else:
	print(chr(ord('a')+ans[0]-1))

Solution (Python):
import sys
import time
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

K = int(input())

ans = ""
p = K
while p > 0:
  p -= 1
  q = p%26
  ans += chr(q + ord("a"))
  p = p//26
print(ans[::-1])

Solution (Python):
def main():
    N = int(input())
    A = [1]
    ret = []
    for _ in range(100):
        A.append(A[-1] * 26)
    for n in range(1, 100):
        
        if N > A[n]:
            N -= A[n]
            continue
        N -= 1
        for _ in range(n):
            N, r = divmod(N, 26)
            ret.append(r)
        break
    ret = [chr(ord('a') + x) for x in ret]
    return ''.join(reversed(ret))


print(main())

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

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

Solution (Python):
import sys
input = sys.stdin.readline
from string import ascii_lowercase as al

n = int(input())
res = ''
while n: n -= 1; res += al[int(n % 26)]; n //= 26
print(res[::-1])

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

for i in range(11):
    if N <= 26 ** (i + 1):
        size = i + 1
        break
    N -= 26 ** (i + 1)

ans = [0] * size
N -= 1
for i in range(size):
    q = N // 26
    r = N % 26
    N = q
    ans[size - 1 - i] = r

ans_chr = ''
for i in range(size):
    ans_chr += chr(ans[i] + 97)

print(ans_chr)

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

Solution (Python):
import string
b = string.ascii_letters
a = int(input())
c = []
while(a>0):
  a-=1
  c.append(b[a%26])
  a=a//26
c.reverse()
print(''.join(c))

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())

index = []
while N > 0:
    N -= 1
    digit = N % 26
    index.append(digit)

    N -= digit
    N //= 26



ans = []
change = list("abcdefghijklmnopqrstuvwxyz")


index.reverse()


for i in range(len(index)):
    ans.append(change[index[i]])


print("".join(ans))

Solution (Python):
x=int(input())
a=1
t=0
while t==0:
	if x-26**a>0:
		x=x-26**a
		a=a+1
	else:
		t=1
y=a-1
x=x-1
ans=[]
for i in range(a):
	ans.extend(chr((x//26**y)+97))
	x=x-(x//26**y)*26**y
	y=y-1

print(*ans,sep='')

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

L = str()

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

i = 0
while n > 0:
    i += 1
    n -= 26 ** i


N -= 26 * (26 ** (i - 1) - 1) // 25

while i > 0:
    code = (N - 1) // (26 ** (i - 1))
    L += alpha[code]
    N -= code * (26 ** (i -1))
    i -= 1

print(L)

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

main()

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

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)) + ans
            N = N // 26
        break
    else:
        N -= 26**i

print(ans)

Solution (Python):
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

n=int(input())
ans=[]
while n>0:
  n-=1
  remain=n%26
  ans.append(remain)
  n=(n)//26
  
ans.reverse()
aa=[]
for i in ans:
  aa_=chr(ord('a')+i)
  aa.append(aa_)
  
print(''.join(aa))

Solution (Python):
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ANS1 = []
ans = ''
while n > 0:
    n -= 1
    ANS1.append(n % 26)
    n //= 26
for i in ANS1[::-1]:
    ans += s[i]
print(ans)

Solution (Python):
N = int(input())
T = N
KISU = 26
Y = []
A = [chr(ord('a') + i) for i in range(26)]
ans = ''
S1 = 0
S1 = 25 if S1 == 0 else S1
while True:
  if T == 0:
    break
  S1 = (T % KISU)
  S1 = 26 if S1 == 0 else S1
  Y.append(S1)
  if S1 == 26:
    T -= 1
  T = T//KISU
for n in Y[::-1]:
  ans += A[n - 1]
print(ans)

Solution (Python):
n = int(input()); ans = '';
while(n):
    x = (26 + n - 1) % 26;
    ans = chr(97 + x) + ans;
    n = (n - x) // 26;
print(ans);

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)) + ans
            N = N // 26
        break;
    else:
        N -= 26**i

print(ans)

Solution (Python):
n=int(input())
name=""
for i in range(15):
  n=n-1
  name=name+chr(97+n%26)
  n=n//26
  if n==0:
    break
print(name[::-1])

Solution (Python):
d = 1000000000000001
n = int(input())
abc = "abcdefghijklmnopqrstuvwxyz"
l = len(abc)

a = 1
while True:
    if n <= l**a:
        break
    n -= l**a
    a += 1
namelen = a

n -= 1
list = []
while True:
    if n < l:
        list.append(n)
        break
    list.append(n % l)
    n = n // l

namelist = ["a"]*namelen

for i in range(len(list)):
    namelist[-i-1] = abc[list[i]]

name = "".join(namelist)
print(name)

Solution (Python):



def f(n):
    if n == 0:
        return ''

    n -= 1
    return f(n // 26) + chr(ord('a') + n % 26)


N = int(input())
print(f(N))

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())
c = ""
while(n!=0):
    n-=1
    c+=chr(ord('a')+n%26)
    n=n//26
print(c[::-1])

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

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())
ans=""
while n>0:
    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 -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Solution (Python):
def numeric_naming(N,M):
    result = []
    added_number = 1

    while N > 0 :
        result.append(0)
        if added_number == 0:
            result[-1] -= 1

        added_number = N % M

        result[-1] += added_number
        
        if result[-1] < 0:
            result[-1] = M -1 
        if result[-1] == 0:
            result[-1] = M
            added_number = 0

        N = N // M

    if result[-1] == M:
        del result[-1]

    result.reverse()
    print(''.join([chr(i + 96) for i in result]))


M = 26
numeric_naming(int(input()),M)

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


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

Solution (Python):
N = int(input())
alp = "abcdefghijklmnopqrstuvwxyz"
output = ""
while N>0:
  N -= 1
  output += alp[N%26]
  N = N//26
  
print(output[::-1])

Solution (Python):
alfabeto = "abcdefghijklmnopqrstuvwxyz"

n = int(input())
resposta = ""

for i in range(1, 99):
    if n <= 26 ** i:
        n -= 1

        for j in range(i):
            resposta += chr(ord("a") + n % 26)
            n //= 26

        break

    else:
        n -= 26 ** i

resposta = resposta[::-1]

print(resposta)

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

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

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

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a')+N%26)
    N //= 26
print(ans[::-1])

Solution (Python):

import sys
input = sys.stdin.readline



def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp


def gcd(a,b):
    if b == 0:
        return a
    return gcd(b, a % b);


def nCr(n, k): 
    if(k > n - k): 
        k = n - k 
    res = 1
    for i in range(k): 
        res = res * (n - i) 
        res = res / (i + 1) 
    return int(res) 


def upper_bound(a, x, lo=0):
    hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo


def primefs(n):
    
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    
    
    return primes


def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 


def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b









def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;




def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x


def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime


MAXN = int(1e7 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    




def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    
    


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

def str_array():
    return input().strip().split();


MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');



n = int(input()); ans = '';
alps = [chr(i) for i in range(97, 97 + 26)];
while(n):
    x = alps[(n % 26) - 1];
    ans = x + ans;
    n = (n-1)//26;
print(ans);

Solution (Python):
n=int(input())
N=n
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"]
t=1
for i in range(1,20):
    if n>26**i:
        n=n-26**i
        t+=1
p=[0]*t
s=0
A=""
for i in range(1,t+1):
    s=N%26
    if s==0:
        s=26
    N=(N-s)//26
    p[t-i]=s
for i in range(t):
    A+=(a[p[i]-1])
print(A)

Solution (Python):
n = int(input())
name = []

while n > 0:
  n -= 1
  r = n % 26
  n = n // 26
  name.append(chr(97+r))

name.reverse()
print("".join(name))

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

def f(n):
    p = 0
    ans=[]
    while True:
        if n >= 26**(p+1):
            n -=26**(p+1)
            p+=1
        else:
            for i in range(p+1):
                ans.append( chr( ord('a') + n%26 ) )
                n //= 26
            break
    print(''.join(reversed(ans)))

f(n)

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

while n/26 >= (1/26):
    m=n%26
    n=n//26
    if m == 0:
        n -= 1
    ans.insert(0,l[m-1])
print("".join(ans))

Solution (Python):
import itertools
import bisect



n = int(input())
al = [0 for _ in range(26)]
for i in range(97,123):
    al[i-97] = chr(i)


sm = [0 for _ in range(20)]
for i in range(1,20):
    sm[i] = int(26*(26**i - 1)/25)



xx = bisect.bisect_left(sm, n)

if(xx > 1):
    rd = n - sm[xx-1]
    ans = []
    tmp = [0 for _ in range(30)]
    for i in range(xx):
        if(xx > 1):
            unt = 26**(xx-i-1)
        if(rd >= unt):
            tmp = [j*unt for j in range(30)]
            num = bisect.bisect_left(tmp,rd)
            ans.append(al[num-1])
            rd -= tmp[num-1]
            
        else:
            ans.append("a")

    print("".join(ans))

else:
    print(al[n-1])

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())
t = N
d = 1
s = ''

while t-26**d > 0:
    t -= 26**d
    d += 1
t -= 1

while t > 0:
    r = t % 26
    t //= 26
    s += chr(r+ord('a'))

s += 'a' * max(0, d-len(s))
print(s[::-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 = ''
while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

Solution (Python):
num = int(input())
data = []
dataAlpha = []

def div_sho(a):
  sho = a // 26
  if a % 26 == 0:
    sho -= 1
  return sho

def div_amari(a):
  amari = a % 26
  if amari == 0:
    amari = 26
  return amari

while num > 26:
  data.append(div_amari(num))
  num = div_sho(num)
  
data.append(num)
data.reverse()

for d in data:
  dataAlpha.append(chr(d + 96))

print("".join(dataAlpha))

Solution (Python):
from sys import stdin

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

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

count=1
while True:
    if N > pow(26,count):
        N -= pow(26,count)
        count +=1
    else:
        break

N-=1
while True:
    if N!=0:
        result.append(text[N%26])
        N=N//26
    elif count!=len(result):
        result.append(text[0])
    else:
        break

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

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ii()
s="abcdefghijklmnopqrstuvwxyz"
ans=""
while(n>0):
    n-=1
    ans+=s[n%26]
    n//=26
print(ans[::-1])

Solution (Python):
import string,sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
abc = string.ascii_lowercase
def main(N):
    if N<=26:
        return abc[N-1]
    if N%26==0:
        return main(N//26-1)+abc[-1]
    return main(N//26)+abc[N%26-1]
print(main(N))

Solution (Python):
def main():
    n=int(input())
    s=""
    while n:
        n-=1
        s=chr(ord('a') + n%26)+s
        n//=26
    print(s)
main()

Solution (Python):
import sys

input_data = []
input_pointer = 0

output_data = []

def input_scan():
    global input_data
    input_data = sys.stdin.readlines()
    input_data = [x[:-1] for x in input_data]

def next_line():
    global input_pointer
    global input_data
    if input_pointer < len(input_data):
        input_pointer += 1
        return input_data[input_pointer - 1]
    else:
        return ""

def append_output(string):
    global output_data
    output_data.append(string)

def print_output():
    global output_data
    output_data.append("")
    sys.stdout.write("\n".join(output_data))















num = int(input())

dictionary = "abcdefghijklmnopqrstuvwxyz"

def convert_to_alpha(num):
    if num == 0:
        return ""
    quot = num // 26
    rem = num % 26
    if rem == 0:
        return "z" + convert_to_alpha(quot - 1)
    else:
        return dictionary[rem - 1] + convert_to_alpha(quot)

name = ""
print("".join(reversed(convert_to_alpha(num))))

Solution (Python):
import string
import math

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

keta = int( math.log(n * 25 + 1, 26) )

st = (26 ** keta - 1 ) // 25
n2 = n - st
ans = []
for i in range(keta):
  ans.append( alp[ n2 % 26 ] )
  n2 = n2 // 26
print(''.join(ans[::-1]))

Solution (Python):
n=int(input())
l=[]
while(n):
  n-=1
  x=n%26
 
  l.insert(0,chr(( x) + ord('a')))
  n//=26
print("".join(l))

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

Solution (Python):
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
ans=''
N=II()
N-=1
for l in range(1,15):
  if N>=26**l:
    N-=26**l
    continue
  for i in range(l):
    d=N%26
    ans+=chr(d+ord('a'))
    N//=26
  ans=ans[::-1]
  break
print(ans)

Solution (Python):
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict


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

Solution (Python):
def II(): return int(input())
N=II()
N-=1
ans=''
for l in range(1,15):
  if N>=26**l:
    N-=26**l
    continue
  for i in range(l):
    d=N%26
    ans+=chr(d+ord('a'))
    N//=26
  ans=ans[::-1]
  break
print(ans)

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):
"""
問題の解釈
長さがlであるような文字列の中で辞書順でk番目のものを求めよ

26進表記における位の値の求め方
1. 変数xをk-1で初期化し、xが0となるまで以下の操作を繰り返す
2. xを26で割った商がq、余りがrであるとする。この操作がi回目に実行された時のrがk-1の下からi番目の桁である。xをqで置き換える
"""
ALPHABET = "abcdefghijklmnopqrstuvwxyz"

n = int(input())



ll = 0
for l in range(1, 12):
    ll += 26**l
    if ll >= n:
        break

ans = []
for li in range(1, l+1):
    r = n % 26
    q = n // 26
    if r == 0:
        q -= 1
    ans.append(r)
    n = q

answer = ""
for s in ans[::-1]:
    answer += ALPHABET[s-1] 
print(answer)

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

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

print(ans[::-1])

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N = int(readline())
    
    
    l = 1
    while N - 26 ** l > 0:
        N -= 26**l 
        l += 1
    
    
    
    N -= 1
    ans = ""
    for _ in range(l):
        ans += chr(ord('a')+N%26)
        N //= 26
    print(ans[::-1])
if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
k=0
c=0
while True:
    if c+1<=n<=26**(k+1)+c:
        k+=1
        break
    k+=1
    c+=26**k

if k==1:
    print(chr(96+n))
    exit()

l=[]
n-=c 
for i in range(1,k+1):
    k1=n//26**(k-i)
    l.append(k1)
    n-=26**(k-i)*(k1-1)

l1=[]
for i in range(1,len(l)+1):
    if l[-i]>=27:
        l[-(i+1)]+=1
        l[-i]-=26
    l1.append(chr(96+l[-i]))

l2=[]
for i in range(1,len(l1)+1):
    l2.append(l1[-i])
print(''.join(l2))

Solution (Python):
def solve(N):
    if N < 26:
        return chr(ord('a') + (N) % 26)
    else:
        return solve(N // 26 - 1) + chr(ord('a') + N % 26)

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

Solution (Python):


import sys
stdin = sys.stdin


def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def f(n):
    res = str()
    while n:
        m = (n-1) % 26
        n = (n-1) // 26
        res = chr(ord("a") + m) + res
    return res

def main():
    n = ni()
    print(f(n))

if __name__ == "__main__":
    main()

Solution (Python):
import sys

def main(n):
    """ main
    """
    result = []

    n = n - 1

    while True:
        result.append(chr(97 + n%26))
        n = int(n / 26) - 1

        if n < 0:
            break

    result.reverse()

    return "".join(result)

if __name__ == "__main__":
    N = int(sys.stdin.readline())

    print(main(N))

Solution (Python):
import sys
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    alpahbet = [chr(ord("a") + i) for i in range(26)]

    ans = []
    while N:
        N -= 1
        ans.append(alpahbet[N % 26])
        N //= 26

    print(*ans[::-1], sep="")


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
Ans = ""
while N>0:
    s = N%26
    if s == 0:
        s = 26
    N = int((N - s)/26)
    Ans = chr(ord("a")+s-1)+Ans

print(Ans)

Solution (Python):
n = int(input())
ans = ''
for i in range(1,100):
    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())
li = list(chr(i) for i in range(97, 123))
ans = ''
while N > 0:
    N -= 1
    ans += li[N % 26]
    N //= 26
print(ans[::-1])

Solution (Python):


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

    
    b = 1
    d = 26
    num = 26
    while N > num:
        b += 1
        d *= 26
        num += d

    N = N - (num - d)
    N -= 1  

    
    ans = ""
    for i in range(b-1, -1, -1):
        a = N//(26**i)
        ans += chr(97+a)
        N -= (26**i)*a

    print(ans)


if __name__ == "__main__":
    solve()

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

chars = 'abcdefghijklmnopqrstuvwxyz'
def to26(n):
  if n <= 0:
    return ''
  mod = 26 if n % 26 == 0 else n % 26
  if n == mod:
    return chars[mod-1]
  n = int((n - mod) / 26)
  return to26(n) + chars[mod-1]

print(to26(n))

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

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)

ans = num2alpha(N)
print(ans)

Solution (Python):
n=int(input())
count=0
for i in range(1,15):
  count+=26**i
  if count>=n:
    keep=i
    break

for i in range(1,keep):
  n-=26**i

n-=1
lis=[]
for i in range(0,keep):
  t=keep-i-1
  one=n//(26**t)
  lis.append(one)
  n-=one*26**t

ans=""
for i in range(len(lis)):
  ans+=chr(97+lis[i])
print(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):
n = int(input())
cha = "abcdefghijklmnopqrstuvwxyz"
ans = []
while n >= 1:
    mod = (n - 1) % 26
    ans.append(mod)
    n = (n - 1) // 26
    
ans_s = ''
for tmp in reversed(ans):
    ans_s += cha[tmp]
print(ans_s)

Solution (Python):
n = int(input())
cha = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while n>=1:
    ans += cha[((n-1)%26)]
    n=(n-1)//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])