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 queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)


if __name__ == '__main__':
    N = intinput()

    
    ret = []
    while N > 0:
        n = N % 26
        n = n if n != 0 else 26
        
        ret.append(n)
        N //= 26
        if n == 26:
            N -= 1
    ret.reverse()
    
    print(''.join(map(lambda e: chr(96+e), ret)))

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

num2alpha = lambda c: chr(c+96)
ans = []
newans = []
string = ''

while num > 0:
    if num % 26 == 0:
        ans.append(26)
    else:
        ans.append(num%26)
    if num < 27:
        break
    num =  int((int(num) - 1) / 26)
    

for item in ans:
    newans.append(num2alpha(item))

for item in reversed(newans):
    string = string + item

print(string)

Solution (Python):
from sys import stdin

def Base_10_to_n(X, n):
    if X == 26:
        return "z"
    alpha = "zabcdefghijklmnopqrstuvwxy"
    X_dumy = X
    out = ''
    while X_dumy>0:
        amari = X_dumy%n
        if amari == 0:
            new = alpha[amari]
            out = new+out
            X_dumy = int(X_dumy/n)-1
        else:
            new = alpha[X_dumy%n]
            out = new+out
            X_dumy = int(X_dumy/n)
    return out

def main():
    n = int(input())
    x16_expr = Base_10_to_n(n, 26)
    print(x16_expr)

if __name__ == "__main__":
    main()

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

while N > 26:
    remainder = N % 26
    quotient = N // 26

    if (remainder == 0):
        remainder = 26
        quotient -= 1

    result += chr(remainder + 64)
    N = quotient

result += chr(N + 64)

print(result.lower()[::-1])

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

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)

name=num2alpha(b)
print(name.swapcase())

Solution (Python):
n = int(input());
a = 1;
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']

while True:
    b = 26*(26 ** a - 1) // 25;
    if b >= n:
        c = a;
        d = b-n;
        break;
    a += 1;

sol = [None]*c;
e = 26 **c -d-1;

for i in range(0,c):
    f = e % (26);
    sol[i] = list[f]
    e = ((e - f)//26);
    
con = ''

for v in range(c):
    con = con + sol[c-1-v];
    
print(con);

Solution (Python):
n = int(input())
word = ''
while n:
    a ,b = divmod(n, 26)
    if b == 0:
        word += (chr(96 + 26))
        n = a - 1
    else:
        word += (chr(96 + b))
        n = a
print(word[::-1])

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

while count > 0:
    out = str(dict[count%26]) + out
    if count%26 == 0:
        count = count - 1
    count = int(count/26)

print(out)

Solution (Python):

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)








n=n0()


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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A =[chr(i) for i in range(97, 97+26)]

L = []
while 1:
    a = N % 26
    N = N // 26
    
    if a == 0:
        N -= 1
    
    
    
    
    
    L.append(a)
    if N <= 0:
        break
ans = ""
L.reverse()
for a in L:
    ans += A[a-1]
print(ans)





exit()
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+","+out
        X_dumy = X_dumy//n
    return out





ans = Base_10_to_n(N, 26)
l = ans.split(",")
print(l)
ans = ""
r = l[:-2]
if Counter(r)["1"]==len(r) and l[-2] == "0":
    
    print("z" * (len(r)))
    exit()

    
    
for a in l:
    if len(a) != 0:
        a = int(a)
        
        
        

        tmp = A[a-1]
        ans += tmp

print(ans)

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

nmax = 1000000000000001

def elc(idx):
    return( chr(ord('a') + idx ) )

lmt = [0]
lst = [1]
cur = 0
kw = 1
ans = []
while(1):
    if cur > nmax :
        break
    kw *= 26
    cur = cur + kw
    lmt.append(cur)
    lst.append(kw)

for i,el in enumerate(lmt):
    
    
    if n > el:
        continue
    
    k = n - lmt[i-1] - 1
    
    j = i - 1
    
    while True:
        wkm = k % lst[j]
        wks = k // lst[j]
        
        ans.append(elc(wks))
        if j == 0:
            
            
            break
        else:
            k = wkm
        j -= 1
    break
print(''.join(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())
M = N
v = 1
while True:
    if(M<=26**v):
        break
    M -= 26**v
    v += 1
if(N<=26):
    anss = al[N%26-1]
else:
  for i in range(v):
      N -= 26**i  
  ans = []
  for i in range(v):
      ans.append("a")
  for i in range(v):
      ans[-i-1]=al[N%26]
      N = N//26
  ans.reverse()
  anss = ""
  for i in range(len(ans)):
      anss += ans[-i-1]
print(anss)

Solution (Python):
n = int(input())
als = ["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"]
ans = []
if n == 1:
  print("a")
  exit()
  
while n > 1:
  amari = n%26
  if amari==0 : n-=1
  alp = als[amari]
  n = n//26
  alp = als[amari]
  ans.append(alp)
  if (n == 1):
    alp = als[n%26]
    ans.append(alp)
print("".join(reversed(ans)))

Solution (Python):
from collections import deque
def add(x):
    return x+97

N = int(input())
i = 1
while N > 26**i:
    N = N - 26**i
    i += 1
    
N -= 1
shinsu = deque([])
for j in range(i):
    shinsu.appendleft(N%26)
    N //= 26

shinsu = list(map(add, shinsu))
ans = list(map(chr, shinsu))
print(''.join(ans))

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'


def calc(x, i):
  target = x - 26 ** i
  if (target <= 0):
    return (x, i)
  else:
    return calc(target, i + 1)


target, index = calc(n, 1)
target -= 1
base26 = [0] * index
for i in range(index):
  tmp, target = divmod(target, 26 ** (index - i - 1))
  base26[i] = tmp
ans = ''
for i in base26:
  ans += s[i]
print(ans)

Solution (Python):
N = int(input())
ans = []

if N <= 26:
    r = N
    print(chr(ord("a")+r-1))
else:
    while N//26>0:
        r = N%26
        r -= 1
        d = N//26
        if r == -1:
            r = 25
            d -= 1
        N=d
        ans.append(chr(ord("a")+r))
    if N>0:
        r = N
        ans.append(chr(ord("a")+r-1))
    ans = ans[::-1]
    print("".join(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)

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

Solution (Python):
ALPHABET = "abcdefghijklmnopqrstuvwxyz"

def alphabet_decimal(v):
    def convert(v):
        while v > 0:
            yield ALPHABET[(v - 1) % len(ALPHABET)]
            v = (v - 1) // len(ALPHABET)
    return ''.join(convert(v))[::-1]
v =int(input())
print(alphabet_decimal(v))

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)


N = int(input())
print(num2alpha(N))

Solution (Python):
import sys

import math
import itertools


n=int(input())
alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=[]
while True:
    b=False
    if(n%26==0):
        b=True
    ans.append(alp[n%26-1])
    if(b):
        n-=1
    n//=26
    if(n==0):
        break
ans.reverse()
print(''.join(ans))

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

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):
def do():
    n=int(input())
    s="abcdefghijklmnopqrstuvwxyz"
    s1=""
    if n<=26:
        return s[n-1]
    else:
        while n>26:
            k=n%26
            n=n//26
            if k==0:
                s1+='z'
                n=n-1
            else:
                s1+=s[k-1]
        s1+=s[n-1]
        s1=s1[::-1]
        return s1
print(do())

Solution (Python):
def ninto26(n):
  num = list(range(1, 26)) + [0]
  alphabets = [chr(i + 97) for i in range(26)]
  
  dic = {n:a for n, a in zip(num, alphabets)}
  s = ""
  
  while n != 0:
    s += dic[n % 26]
    
    i = 0
    while 26 ** (i + 1) <= n:
      i += 1
    
    if n % 26 != 0:
      n -= (n % 26)
    else:
      n -= 26
      
    n //=  26
  return s

N = int(input())

print("".join(list(reversed(ninto26(N)))))

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



a=[]
a.append(0)
         
for i in range(12):
  t = 26**i + a[i]
  if N >= t:
    x = i+1 
  a.append(t)




b=N-a[x] 

c=[]


for i in range(x):
  tmp=0
  d=0
  if len(c) == 0:
    d=b // 26**(x-i-1)
  else:
    for j in range(len(c)):
      tmp += 26**(x-j-1)*c[j]
    
    d=(b-tmp) // 26**(x-i-1)
  
  c.append(d)



x=ord("a")
for i in range(len(c)):
  print(chr(x+c[i]), end="")

Solution (Python):
a = "zabcdefghijklmnopqrstuvwxy"
number = int(input())
result = ""
for i in range(13):
    result += a[int(number % 26)]
    if number % 26 == 0:
        number -= 26
    if number // 26  == 0:
        break
    number = number // 26
result = result[::-1]
print(result)

Solution (Python):
def wa(x):
    y=int(26*(26**x-1)/25)
    return y

n=int(input())
kake=0
count=0
ans=""
kotae=[]
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']

while(n>kake):
        count+=1
        kake=wa(count)

n-=wa(count-1)
n-=1
for x in range(count):
    kotae.append(al[n%26])
    n=n//26
for x in range(count):
    ans+=kotae[count-1-x]
print(ans)

Solution (Python):
N = int(input())
alp = [chr(ord('a') + i) for i in range(26)]
result = []
def Base10_to_alp(n):
    quot = int(n / 26)
    surplus = n % 26
    quot -= 1 if surplus == 0 else 0
    surplus = 26 if surplus == 0 else surplus
    result.append(surplus)
    if 26 < quot:
        Base10_to_alp(quot)
    elif 26 < n:
        result.append(quot)
    return "".join([alp[i - 1] for i in reversed(result)])
print(Base10_to_alp(N))

Solution (Python):
n = int(input())
ans = ''
l = []
while n>0:
    w = chr(96+n%26)
    if not n%26:
        w = 'z'
        n-=26
    l.append(w)
    n = int(n//26)
l.reverse()
ans = ''.join(l)
print(ans)

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):
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"]
n = int(input())
ans = []
a = 0
for num in range(1, 12):
  a += 26 ** num
  if n <= a:
    n -= (a - 26 ** num)
    break

for i in range(num, 0, -1):
  for j in range(26):
    if n <= 26 ** (i-1) * (j+1):
      n -= 26 ** (i-1) * j
      ans.append(alpha[j])
      break

print("".join(ans))

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

ANS = []
c = 26
p = 97

while True:
    N -= 1
    n = N % 26
    ANS.append(chr(p + n))

    if N < 26:
        break

    N -= n
    N //= 26


print("".join(map(str, ANS[::-1])))

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter











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

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
ans = ""
while n > 0:
    m = n%26
    nya = m-1 if m-1 >= 0 else 25
    ans += chr(ord('a') + nya)
    n -= nya
    n//=26
print(ans[::-1])

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    res = num2alpha(n)

    return res

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)

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)

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

def Base_10_to_n(x, n):
    tmp = x
    out = []
    while tmp>0:
        out.append(tmp % n)
        tmp = tmp // n 
    return out

keta = 1
tmp = 26
while tmp <= n:
    keta += 1
    tmp += 26**keta

n -= (tmp - 26**keta)

ans = []
for i in Base_10_to_n(n,26):
    ans.append(chr(ord('a')+i))
while keta!=len(ans):
    ans += ['a']
print("".join(reversed(ans)))

Solution (Python):
n=int(input())
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"]
ans=[]
while n>26:
  x=n%26
  if x==0:
    ans.append("z")
    n=(n//26)-1
  else:  
    ans.append(l[x-1])
    n=n//26
ans.append(l[n-1])
ans.reverse()
Ans=""
for i in range(len(ans)):
  Ans=Ans+ans[i]
print(Ans)

Solution (Python):
n=int(input())
T='abcdefghijklmnopqrstuvwxyz'
s=''
while n>0:
    sn=n%26
    if sn>0:
        s=T[sn-1]+s
        n//=26
    else:
        s=T[25]+s

        n=n//26-1

print(s)

Solution (Python):
N = int(input())
S = N
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"]
A = []
li = [0]
li2 = []
for i in range (14):
    li.append(26**(1+i))
a = 0
for j in range (14):
    a += li[j]
    li2.append(a)
k = 0
while(N > li2[k]):
    k+=1

S -= (li2[k-1] +1)
amari = S % 26
K = S
for l in range (k):
    A.append(B[(K//li[k - l])])

    K = K % li[k - l]
A.append(B[amari])
print(''.join(A[1:]))

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    Norg = N

    ans = []

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

    ans.append(N)

    ansstr = []
    for i, a in enumerate(ans[::-1]):
        ansstr.append(chr(ord("a") + a))
    print("".join(ansstr))

if __name__ == '__main__':
    main()

Solution (Python):
import itertools

n = int(input())

keta = 1
abc_list = 'abcdefghijklmnopqrstuvwxyz'
c = 0
while keta < 17:
    c += 26 ** keta
    
    if n <= c:
        
        num = (26 ** keta) - (c-n)-1
        
        
        
        i_t = 0
        
        ans = ''
        for i in range(keta-1, -1, -1):
            
            idx = num // (26 ** (i))
            
            ans += abc_list[idx]
            num -= (num // (26 ** i)) * (26 ** i)
        print(ans)
        break

    keta += 1

Solution (Python):
from string import ascii_lowercase

n = int(input())
res = []

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


res.reverse()
print("".join(res))

Solution (Python):
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","z"]
x=n
b=1
z=a[x%26-1]
x=x-26
while x>0:
    i=(x-1)//(26**b)
    y=i%26
    z+=a[y]
    b+=1
    x=x-(26**b)
t=z[::-1]
print(t)

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

Solution (Python):
from math import log, ceil
r = 26
ab = "abcdefghijklmnopqrstuvwxyz"
input = raw_input
n = int(input())

def answer(n):
    m = int(ceil(log(n*(r-1) + r, r))) - 1

    
    out = ""

    sub = (r ** m - r) // (r-1)
    n = n - sub - 1
    for i in range(m):
        i = n % r
        out = ab[i] + out
        n //= r
        
        
        
        
    return out


if True:
    out = answer(n)
    
    print(out)

Solution (Python):
a = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510,
     3817158266467286]
b = [26, 702 - 26,
     18278 - 702, 475254 - 18278,
     12356630 - 475254, 321272406 - 12356630,
     8353082582 - 321272406, 217180147158 - 8353082582,
     5646683826134 - 217180147158, 146813779479510 - 5646683826134,
     3817158266467286 - 146813779479510]
c = 'abcdefghijklmnopqrstuvwxyz'

n = int(input())
d = 0

for i in range(11):
    if n < a[i] +1:
        d = i
        break

if d == 0:
    print(c[n-1])
    exit(0)

cnt = [0] * (d+1)
n -= a[d-1] +1

for i in range(d):
    cnt[i] = n // (b[d-1 - i])
    n = n-cnt[i]*(b[d-1-i])

cnt[d] = n

for i in range(d+1):
    if i == d:
        print(c[cnt[i]])
    else:
        print(c[cnt[i]],end="")

Solution (Python):
import string


def main():
  alpha = string.ascii_lowercase

  def to_n(X, n, list_=[]):
    X_dumy = X
    while X_dumy > 0:
      list_.insert(0, X_dumy % n)
      X_dumy = int(X_dumy/n)
    return list_

  N = int(input())
  res = N
  counter = 0
  while res > 0:
    counter += 1
    res -= 26**counter

  res += 26**counter
  res -= 1
  idx = to_n(res, 26)
  
  while len(idx) < counter:
    idx.insert(0, 0)
  
  
  print('{:<}'.format(''.join(list(map(lambda i: alpha[i], idx)))))

if(__name__ == '__main__'):
  main()

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

i=0
while True:
    tmp=n % (26 ** (i+1))
    outnum.append(tmp // (26**i))
    if tmp == 0:
        tmp = 26 ** (i+1)
    n -= tmp
    if n == 0:
        break
    else:
        i += 1

outnum.reverse()
out=[]
for ou in outnum:
    out.append(alp[ou-1]) 
print("".join(out))

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

a=n
count=0
for i in range(11):
    if a-26**(i+1)>0:
        a-=26**(i+1)
        count+=1
    else:
        break

a-=1



ans=[]
for j in range(count):

    ans.append(a//26**(count-j))
    a%=26**(count-j)
ans.append(a%26)


m=len(ans)

letter=[]
for i in range(m):
    
    if i==m-1:
        letter.append(chr(97+ans[i]))
    else:
        letter.append(chr(97+ans[i]))

print(''.join(letter))

Solution (Python):
num = int(input())
letter = ""
while num > 0:
    num, remainder = divmod(num - 1, 26)
    letter = chr(65 + remainder) + letter
print(letter.lower())

Solution (Python):


import math

N = int(input())
count = 0
count2 = 0

al=[chr(ord('a') + i) for i in range(26)]

thresh = [26**i for i in range(1,12)]
for i in range(1,len(thresh)):
 thresh[i] = thresh[i] + thresh[i-1]
 
for i in range(len(thresh)):
    if thresh[i] <N:
        continue
    else:
        char_num = i+1
        name_str = ['a' for i in range(char_num)]
        if char_num > 1:
            count = N-thresh[i-1]
            
            for i in range(char_num):
                count2 = int((count-1)/(26**(char_num-i-1)))
                if (count2 > 0)&(i!=(char_num-1)):
                    if count2 <= 25:
                        name_str[i] = al[count2]
                        count = count - ((26**(char_num-i-1))*count2)
                    else:
                        name_str[i] = al[count2-1]
                        count = count - ((26**(char_num-i-1))*count2)
        else:
            count = N
        if count > 0:
            name_str[-1] = al[count-1]
        break
    
    
out = ""
for i in name_str:
    out = out + i
print(out)

Solution (Python):

n = int(input())
chars=[chr(ord('a')+i) for i in range(26)]
ans = []
while True:
    sho = (n - 1) // 26
    amr = n % 26
    
    ans.insert(0, chars[amr - 1])
    if sho == 0:
        break
    n = sho
print("".join(ans))

Solution (Python):
def solve():
	arr = "zabcdefghijklmnopqrstuvwxy"
	N = int(input())
	ans = ""
	power = int(26**10)
	while N > 0:
		ans = arr[N % 26] + ans
		if (N % 26 == 0):
			N = N // 26
			N -= 1
		else:
			N = N // 26
	return ans


def main():
	
	print(solve())


if __name__ == '__main__':
	main()

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)

a = int(input())

a1 = str.lower(num2alpha(a))

print(a1)

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

Solution (Python):
import math

N = int(input())
alphas = 'abcdefghijklmnopqrstuvwxyz'
alphabets = [str(alphas[i]) for i in range(26)]
ans = ''

while (N>=1):
  ans = alphabets[int((N%26)-1)]+ans
  if N%26==0:
    N = int(N/26-0.1)
  else:
    N = int(N/26)

print(ans)

Solution (Python):
import sys
import string











stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    n = int(stdin.readline().rstrip())
    
    
    
    
    
    
    letter = string.ascii_lowercase
    ans = str(num2alpha(n))
    ans = ans.lower()
    print(ans)


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)

main()

Solution (Python):
N = int(input().strip())
val = ['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', 'z']
key = [i for i in range(27)]
corr_dict = {}

for key, val in zip(key, val):
  corr_dict[key] = val

ans = ''
num = N
while num > 26:
  ans += corr_dict[num%26]
  num = (num-1)//26

if num == 0:
    print(ans[::-1])
else:
    ans += corr_dict[num%26]
    print(ans[::-1])

Solution (Python):
arr = [[1, 26], [27, 702], [703, 18278], [18279, 475254], [475255, 12356630], [12356631, 321272406], [321272407, 8353082582], [8353082583, 217180147158], [217180147159, 5646683826134], [5646683826135, 146813779479510], [146813779479511, 3817158266467286]]
alphabets = ['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())

def solve(n):
    if n <= 26:
        return alphabets[n-1]
    
    x = n % 26
    if x == 0:
        return alphabets[x-1] + solve((n // 26) - 1)
    return alphabets[x-1] + solve(n // 26)

print(solve(n)[::-1])

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()

	print(num2alpha(N).swapcase())

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__":
	main()

Solution (Python):
num = int(input())
def num_to_lett(num):
    string = ""
    while num > 0:
        num, remainder = divmod(num - 1, 26)
        string = chr(65 + remainder) + string
    return string.lower()
print(num_to_lett(num))

Solution (Python):
n = int(input())
ans = ""
c = 1
a = []
for i in range(9):
    if i == 0:a.append(26)
    else:a.append(a[i-1]+26**(i+1))
if n <= 26:
    print(chr(n+96))
else:
    while n >= 1:
        if n%26 == 0:
            ans += "z"
        else:
            ans += chr(n%26+96)
        n -= 1
        n = n//26
        c += 1
    print(ans[::-1])

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

while True:
    alpha = int(n % 26)
    if alpha == 0:
     result += "z"
     n -= 1
    else:
     result += chr(alpha + 96)
    if n/26 < 1:
        break
    n /= 26
rslt = result[::-1]
print(rslt)