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



Sample input:
2


Sample output:
b

Submission status: Accepted

Solution code:
## necessary imports
import sys
input = sys.stdin.readline
#from math import ceil, floor, factorial;

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

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

## nCr function efficient using Binomial Cofficient
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) 

## upper bound function code -- such that e in a[:i] e < x;
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

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    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
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
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 

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
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;


# the union function which makes union(x,y)
# of two nodes x and y
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

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
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

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e6 + 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;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
# spf = [0 for i in range(MAXN)]
# spf_sieve() 
def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()))
## taking string array input
def str_array():
    return input().strip().split();

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

n = int(input());
digits = []; b = 26;
while(n):
    n -= 1;
    digits.append(n % b);
    n //= b;
ans = '';
for i in digits:
    ans = chr(97 + i) + ans;
print(ans);

Submission status: Accepted

Solution code:
n = int(input())
name = []
while n > 0:
    n, m = divmod(n, 26)
    if m == 0:
        n -= 1
        m = 26
    name.insert(0, chr(m + 96))
print("".join(name))

Submission status: Accepted

Solution code:
a=int(input())
name=""
while a>0:
    a-=1
    name+=chr(97+a%26)
    a//=26
print(name[::-1])

Submission status: Accepted

Solution code:
n = int(input())

name = ""

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

Submission status: Accepted

Solution code:
N = int(input())
alph = {key + 1: val for key, val in enumerate('abcdefghijklmnopqrstuvwxyz')}
alph[0] = 'z'
answer = ''
while N >= 1:
  answer = alph[N % 26] + answer
  if N == 26:
    break
  N = (N - 1) // 26

print(answer)

Submission status: Accepted

Solution code:
import numpy as np

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

while(N > 0):
    tmp = N % 26
    if tmp == 0:
        ans += "z"
        N = N // 26 - 1
        continue
    ans += chr(96 + tmp)
    N = N // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
check = 'abcdefghijklmnopqrstuvwxyz'

while n != 0:
    n -= 1
    ans += check[n%26]
    n = n//26

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input());
ans = '';
ptr = 0;
while(n>0):
  n-=1;
  temp = n%26;
  n=n//26;
  ans = chr(97+temp)+ ans 
print(ans)

Submission status: Accepted

Solution code:
A_UPPERCASE=97
ALPHABET_SIZE=26
def _decompose(number):
    """Generate digits from `number` in base alphabet, least significants
    bits first.

    Since A is 1 rather than 0 in base alphabet, we are dealing with
    `number - 1` at each iteration to be able to extract the proper digits.
    """

    while number:
        number, remainder = divmod(number - 1, ALPHABET_SIZE)
        yield remainder


def base_10_to_alphabet(number):
    return ''.join(
            chr(A_UPPERCASE + part)
            for part in _decompose(number)
)[::-1]
print(base_10_to_alphabet(int(input())))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def main(N: int) -> None:
    """
    求解処理.

    Args:\n
        N (int): 整数
    """
    # 求解処理
    ans = ""
    while N > 0:
        N -= 1
        ans += chr(ord("a") + N % 26)
        N //= 26
    ans = ans[::-1]

    # 結果出力
    print(ans)


if __name__ == "__main__":
    N = get_input()
    main(N)

Submission status: Accepted

Solution code:
num = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

while num > 0:
    num -= 1
    num, rest = divmod(num, 26)
    ans += s[rest]
print(ans[::-1])

Submission status: Accepted

Solution code:
s = "zabcdefghijklmnopqrstuvwxyz"
n = int(input())
ans = ""
while(n>0):
    r = n%26
    if r==0:
        r = 26
    ans = s[r] + ans
    n -= r
    n //=26
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
# 26 ** 9 < 1000000000000001 < 26 ** 10 なので最大でも(9+1)桁の文字
index = [None] * 11
n = N
for i in range(0, 11, 1):
  a = n % 26
  if a == 0:
    index[i] = 26
    n = (n // 26) - 1
  else:
    index[i] = a
    n = n // 26  
  if n == 0:
    break
  
word = ''
for i in index:
  s = ''
  if i:
    s = chr(ord('a') + i - 1)
    word += s
print(word[::-1])

Submission status: Accepted

Solution code:
N = int(input())

res = ""
while N > 0:
    N -= 1
    r = N % 26
    res = chr(r + 97) + res
    N //= 26
print(res)

Submission status: Accepted

Solution code:
N = int(input())

res = ""
while N > 0:
    r = (N - 1) % 26
    res = chr(r + 97) + res
    N -= r + 1
    N //= 26
print(res)

Submission status: Accepted

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

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

print(ans[::-1])

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    cnt = 0
    while n > 0:
        cnt += 1
        n = n - 26 ** cnt

    ans = ''
    if n == 0:
        print(''.join(['z' for _ in range(cnt)]))
        return

    n -= 1
    for i in range(cnt):
        ans = alphabet[n % 26] + ans
        n //= 26

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
alp = [chr(i) for i in range(ord('a'), ord('z')+1)]
ans = []

while N > 0:
    res = N % 26
    ans.append(alp[res - 1])
    N //= 26
    if res == 0:
        N -= 1

ans = ans[::-1]
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
P=''
while True :
    P=chr(ord('a')+(N-1)%26)+P
    N=(N-1)//26
    if N <= 0 :
        break
print(P)

Submission status: Accepted

Solution code:
n=int(input())
n-=1
i=26
c=1
while n-i>=0:
    n-=i
    i*=26
    c+=1
al=list('abcdefghijklmnopqrstuvwxyz')
ans=[]
for i in range(c):
    ans.append(al[n%26])
    n=n//26
ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
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']

name=[]

for i in range (20):
    N=N-1
    name.insert(0,a[N%26])
    N=N//26
    if N==0:
        break

print(''.join(name))

Submission status: Accepted

Solution code:
from collections import deque

N = int(input())
mod = 26
count = 1

for i in range(11):
    if N > mod ** (i+1):
        N -= mod ** (i+1)
        count += 1
    else:
        break

tmp = N-1
num = deque([0 for i in range(count)])

for i in reversed(range(len(num))):
    num[i] = chr(ord('a') + tmp % mod)
    tmp = tmp // mod

print(''.join(num))

Submission status: Accepted

Solution code:

def main():
    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])
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(N):
    if N == 0: return ""
    N -= 1
    return f(N//26) + chr(97 + N%26)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 意外とめんどくさいけど， よく考えると，末尾だけはかんたんにきまる．末尾から順番に決定していけばいいのだ．
N = int(input())
AL = []
while N >0:
    N -= 1
    amari = N % 26 # 26番目の要素は25にする
    AL.append(amari)
    N = int(N // 26)

S = [chr(ord('a')+al) for al in AL]

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

Submission status: Accepted

Solution code:
# C - One Quadrillion and One Dalmatians

N = int(input())

ans = ''
while N > 0:
    N -= 1
    t = N % 26
    ans = chr(t+97) + ans
    N //= 26

print(ans)

Submission status: Accepted

Solution code:
num = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

while num > 0:
    num -= 1
    num, rest = divmod(num, 26)
    ans += s[rest]
    #if rest == 0:
        #num -= 1
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
number = ""

while n != 0:
    a = n % 26
    if a == 0:
        number += (chr(a + 26 + 96))
        n = n // 26 - 1
    else:
        number += (chr(a + 96))
        n = n // 26
number = number[::-1]
print(number)

Submission status: Accepted

Solution code:
N = int(input())
lst = []
while N > 0:
    a = N % 26
    if a == 0:
        a = 26
        N -= 26
    lst.append(chr(96 + a))
    N //= 26

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
number = ""

while n != 0:
    n = n - 1
    number += (chr(n % 26 + 97))
    n = n // 26
number = number[::-1]
print(number)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = ""
while n:
    n -= 1
    ans += chr(n%26+ord("a"))
    n //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
lst = []
while N > 26:
    N -= 1
    lst.insert(0,chr(N % 26 + 97))
    N //= 26
lst.insert(0,chr(N+96))
print(*lst,sep="")

Submission status: Accepted

Solution code:
n=int(input())
#x,n=map(int,input().split())
#pl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 21 21:09:05 2020

@author: naoki
"""

def base(n,b):
    p = n
    digits = "abcdefghijklmnopqrstuvwxyz"
    s=[]
    while p >=1:
        if p >=27:
            if p%b == 0:
                s.append(digits[25])
                p = p // b - 1  
            else:    
                s.append(digits[p%b-1])
                p = p // b
        else:
            s.append(digits[p - 1])
            p = 0
    return "".join(reversed(s))
N = int(input())
print(base(N,26))

Submission status: Accepted

Solution code:
N = int(input())
alpha =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
x = 1
Z = 'A'
while N > 0:
    if N % 26 == 0:
        Z += 'z'
        N = (N - 1)  //26
    else:
        Z += alpha[((N - 1)  % 26)]
        N = N // 26
#    print(Z) 
#Z += alpha[N - 1]
#print('Z = ', Z)
for i in range(len(Z) - 1, 0 , -1):
    print(Z[i], end = '')

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)
from string import ascii_lowercase
t=ascii_lowercase
ans=""
n=int(input().rstrip())
while n>0:
    n-=1
    ans+=t[n%26]
    n//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
import math

n=int(input())

prev=0
val=26
count=1
while prev+val<n:
    prev=val+prev
    val*=26
    count+=1
   
n=n-prev-1

init=ord('a')
ans=""
while count:
    q,r=divmod(n,26)
    n=q
    ans+=chr(init+r)
    count-=1

print(ans[::-1])

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
S = []
for i in range(1,100):
    if N < 27:
        break
    N -= 1
    S.append(chr(ord('a')+N%26))
    N = N//26
S.append(chr(ord('a')+N-1))
print(''.join(S[::-1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
N -= 1
s = []
for i  in range(12):
    s.append(chr(ord("a")+N%26))
    N //= 26
    if N==0:
        break
    N -= 1
s.reverse()
print(*s, sep="")

Submission status: Accepted

Solution code:
N=int(input())

l=[]
while N>0:
    N-=1
    a=N%26
    N=N//26
    moji=chr(ord('a')+a)
    l.append(moji)

ans=''.join(l)

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# from math import sqrt, gcd, ceil, log
# from bisect import bisect
# from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)



def solve():
	n = int(input()); alph = ['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']
	i = 0; s = 0
	while n >= s + 26**(i):
		s += 26**i
		i += 1
	# print(i, s)
	s = n-s

	ans = ["a"]*i
	while s > 0:
		ans[i-1] = chr(97+s%26)
		i -= 1
		s //= 26
	print(("").join(ans))
		

if __name__ == "__main__":
	solve()

Submission status: Accepted

Solution code:
N = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"
ans = ""
while True:
    la = N // 26
    sm = N % 26
    if sm == 0:
        sm = 26
        la -= 1
    ans += chars[sm]
    N = la
    if N < 1:
        break
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

pre_num = 0
cur_num = 26
length = 1
while n > cur_num:
  length += 1
  pre_num = cur_num
  cur_num += 26 ** length

n -= pre_num + 1
name = []
a = ord('a')
for _ in range(length):
  c = n % 26
  n //= 26
  name.append(chr(a + c))
print(''.join(name[::-1]))

Submission status: Accepted

Solution code:
import numpy as np
def resolver(N):
    N -= 1
    digits = "abcdefghijklmnopqrstuvwxyz"
    i = 1
    while True:
        if N < 26**i:
            break
        N -= 26**i
        i += 1
    
    number = []
    for _ in range(i):
        tmp = N % 26 
        number.append(tmp)
        N //= 26

    ans = "".join([digits[i] for i in reversed(number)])
    return ans

def test():
    for i in range(1,100):
        ans = resolver(i)
        print(f"\ri={i:03} {ans}", end="")
    print()

def main():

    #test()

    N = int(input())
    
    ans = resolver(N)

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np

bases = [26 ** i for i in range(15)]
cum_sum = np.cumsum(bases)


def int2alpha(i):
    assert i > 0
    return chr(i + 96)


def to_26_base(num):
    res = []
    for i in reversed(range(14)):
        b = bases[i]
        # print(num, b, cum_sum[i])
        if cum_sum[i] <= num < cum_sum[i + 1]:
            if i == 0:
                q = num // b
            else:
                q = (num - cum_sum[i-1]) // b
            num -= q * b
            res.append(q)
    return "".join(int2alpha(x) for x in res)


def solve(N: int):
    print(to_26_base(N))
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N = int(input())
    ans = []
    while N:
        N -= 1
        ans.append(chr(N%26 + 97))
        N //= 26
    print(''.join(map(str,ans[::-1])))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc171/tasks/abc171_c

import sys
input = sys.stdin.readline
import string

numbers = string.digits                             # [0-9] をロード
abc = string.ascii_lowercase                        # [a-z] をロード
ABC = string.ascii_uppercase                        # [A-Z] をロード
characters = numbers + abc + ABC                    # [0-9] + [a-z] + [A-Z] の 62進数まで対応


def base_cvt(value, n=2, output=characters):        # n=26, output=abc で、[a-z]表示の26進数を生成可能
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)   # 整数以外はアウト

    if n < 2 or n > len(characters):                # 62進数まで対応
        raise ValueError('Invalid n:', value)

    coef = []
    while tmp >= n:
        idx = tmp % n                               #  tmp = a_k n^k + ... a_1 n^1 + a_0 n^0 の a_0 の値を取り出す
        coef.append(idx)
        tmp = tmp // n                              # a_k n^k + ... a_1 n^1 + a_0 n^0 ⇒　a_k n^k + ... a_1 n^1　:最小桁を消去してループ
    idx = tmp % n
    coef.append(idx)                                # coef = [a_0, a_1, ... , a_k]
    res = "".join(map(lambda x: output[x], reversed(coef)))
    return res

#####################################################################################################
  
  
N = int(input())

k = 0
while N - 26 ** k >= 0:
    N -= 26 ** k
    k += 1

res = base_cvt(N, 26, abc)
l = len(res)
print("".join(["a"] * (k - l)) + res)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc171/tasks/abc171_c

import string

numbers = string.digits                             # [0-9] をロード
abc = string.ascii_lowercase                        # [a-z] をロード
ABC = string.ascii_uppercase                        # [A-Z] をロード
characters = numbers + abc + ABC                    # [0-9] + [a-z] + [A-Z] の 62進数まで対応


def base_cvt(value, n=2, output=characters):        # n=26, output=abc で、[a-z]表示の26進数を生成可能
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)   # 整数以外はアウト

    if n < 2 or n > len(characters):                # 62進数まで対応
        raise ValueError('Invalid n:', value)

    coef = []
    while tmp >= n:
        idx = tmp % n                               #  tmp = a_k n^k + ... a_1 n^1 + a_0 n^0 の a_0 の値を取り出す
        coef.append(idx)
        tmp = tmp // n                              # a_k n^k + ... a_1 n^1 + a_0 n^0 ⇒　a_k n^k + ... a_1 n^1　:最小桁を消去してループ
    idx = tmp % n
    coef.append(idx)                                # coef = [a_0, a_1, ... , a_k]
    res = "".join(map(lambda x: output[x], reversed(coef)))
    return res


N = int(input())

k = 0
while N - 26 ** k >= 0:
    N -= 26 ** k
    k += 1

res = base_cvt(N, 26, abc)
l = len(res)
print("".join(["a"] * (k - l)) + res)

Submission status: Accepted

Solution code:
from collections import defaultdict
it = lambda: list(map(int, input().strip().split()))
INF = float('inf')


if __name__ == '__main__':
    N = int(input())
    ans = ''
    while N:
        if N % 26 == 0:
            ans = chr(ord('a') + 25) + ans
            N //= 26
            N -= 1
        else:
            ans = chr(ord('a') + N % 26 - 1) + ans
            N //= 26
    print(ans)

Submission status: Accepted

Solution code:
N = int(input())
Alph = [chr(i) for i in range(97, 97+26)]
keta = 1
allz = 26**keta
ans = ""
bifallz = 0
27

while N > allz:
    keta += 1
    bifallz = allz
    allz += 26**keta
    
N = N - (bifallz + 1)

for k in range(keta):
    ans += Alph[N%26]
    N = N//26

print(ans[::-1])

Submission status: Accepted

Solution code:
N=int(input())
chars="Xabcdefghijklmnopqrstuvwxyz"
res=""
n_rem=N
while True:
  x=n_rem%26
  if x==0:
    x=26
  res+=chars[x]
  n_rem-=x
  if n_rem==0:
    break
  n_rem//=26
print(res[::-1])

Submission status: Accepted

Solution code:
n = int(input())

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

print(Base_10_to_n(n - 1, 26))

Submission status: Accepted

Solution code:
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',
]
res = []
while N > 0:
    a = (N - 1) % 26
    N = (N - 1) // 26
    res.append(A[a])
res.reverse()
print(''.join(res))

Submission status: Accepted

Solution code:
digit=list('abcdefghijklmnopqrstuvwxyz')
N=int(input())
ans=[]

for i in range(10):
    if N % 26 ==0:
        d=26
    else:
        d=N%26

    N = N-d
    N = N//26
    ans.append(d)

    if N<=26:
        ans.append(N)
        break

ans=ans[::-1]
ans2=''

for i in ans:
    if i !=0:
        ans2 += digit[i-1]

print(ans2)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    ans = ''
    for i in range(1, 20):
        if n <= 26**i:
            n -= 1
            for j in range(i):
                ans += chr((n % 26) + ord('a'))
                n //= 26
            print(ans[::-1])
            return
        else:
            n -= 26**i

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
alp=[]

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


while(True):
  K=-1
  K = int(N%26)
  alp.insert(0,mozi[K-1]) 
  if(N<=26):break
  if(K==0):N =(N-26)/26
  else:N = (N-K)/26
    
print(''.join(alp))

Submission status: Accepted

Solution code:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


# https://atcoder.jp/contests/abc171/tasks/abc171_c
def solve(n):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    reversed_result = ""
    while n > 0:
        curr = n % 26
        curr = 25 if curr == 0 else curr - 1
        reversed_result += alphabet[curr]
        n -= curr
        n //= 26
    return reversed_result[::-1]



if __name__ == "__main__":
    n = int_in()
    out(solve(n))

Submission status: Accepted

Solution code:
n = int(input())
num = 26
alphabet =  [chr(ord('a') + i) for i in range(26)]
ans = []
while n > 0:
    n -= 1
    ans += alphabet[n % num]
    n = n // num
    
ans.reverse()
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
alpha = string.ascii_lowercase

n = int(input())

ans = []
while (n):
    res = (n % 26)
    # print("n % 26: ", n % 26)
    # print("letra: ", alpha[res-1])
    # print(" n // 26: ", n // 26)
    ans.append(alpha[res-1])
    if (n <= 26):
        break
    if n % 26:
        n = n // 26
    else:
        n = n // 26
        n = n - 1


# print(ans)
ans = ans[::-1]
print("".join(ans))

# 1 -> 26
# 2 -> 26 * 26 + 26
# 3 -> 26 * 26 * 26

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    al = 'abcdefghijklmnopqrstuvwxyz'
    ret = ''
    while N>0:
        N -=1
        ret += al[N%26]
        N//=26
    print(ret[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
result =[]
alphabet = "zabcdefghijklmnopqrstuvwxy"
while(N>0):
    t = N%26
    result.append(alphabet[t])
    N = N//26
    if t == 0:
        N -= 1
result.reverse()

print(''.join(result))

Submission status: Accepted

Solution code:
N = int(input())
N -= 1

for l in range(1, 100):
    if N >= 26**l:
        N -= 26**l
    else:
        ans = ""
        for i in range(l):
            ans += chr(ord('a') + N % 26)
            N //= 26
        print(ans[::-1])
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = ''
alphabet = 'zabcdefghijklmnopqrstuvwxy'
while N > 0:
  ans +=alphabet[N%26]
  N = (N-1)//26
print(ans[::-1])

Submission status: Accepted

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

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input()) 
A=[chr(u) for u in range(97,123)]
na=""
while n>0:
  q=n%26
  na+=A[q-1]
  n= n//26 if n%26!=0 else n//26-1
  
print(na[::-1])

Submission status: Accepted

Solution code:
n=int(input())
l=[]
s=""
while n>0:
    n=n-1
    a=n%26
    s=chr(a+97)+s
    n=n//26
print(s)