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:
N = int(input())
al = [chr(i) for i in range(97, 97+26)]
ans = ""
while True:
    temp = N % 26
    ans = al[temp-1] + ans
    if N // 26 == 0:
        break
    else:
        if N == 26:
            break
        if N % 26 == 0:
            N = N // 26 - 1
        else:
            N = N // 26

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = 1
ans = ''
abc = [chr(ord('a') + i) for i in range(26)]
while N>26**a:
  N -= 26**a
  a += 1
ans += abc[N%26-1]
if a >= 2:
  N = (N-1)//26
for i in range(a-1):
  ans += abc[N%26]
  N = N//26
print(ans[::-1])

Submission status: Accepted

Solution code:
A='abcdefghijklmnopqrstuvwxyz'
n=int(input())-1
p=26
d=1
while n>=p:
    n-=p
    p*=26
    d+=1
ans=[None]*d
#print(n)
for i in range(d):
    ans[d-i-1]=A[n%26]
    n//=26
print(*ans,sep='')

Submission status: Accepted

Solution code:
a = int(input())
counter = 1
sum_num = 26 ** counter
before_sum_num = 0

while True:
  if a <= sum_num:
    a -= before_sum_num
    a -= 1
    for i in range(counter, 0, -1):
      z = a // (26 ** (i - 1))


      a = a % (26 ** (i-1))
      print(chr(ord('a') + z), end='')
    break

  else:
    before_sum_num = sum_num
    counter += 1
    sum_num += 26 ** counter

print()

Submission status: Accepted

Solution code:
from string import ascii_lowercase

n = int(input())
name = ''

while n != 0:
    name = ascii_lowercase[(26 if n % 26 == 0 else (n % 26)) - 1] + name
    n -= (26 if n % 26 == 0 else (n % 26))
    n //= 26

print(name)

Submission status: Accepted

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


def f(x):
    ans = chr(x[0] + ord('a') - 1)
    

def solve(N: int):
    '''
    >>> solve(1)
    'a'
    >>> solve(26)
    'z'
    >>> solve(18278)
    'zzz'
    >>> solve(475255)
    'aaaaa'
    '''
    ans = []
    n = N
    while n > 0:
        ans.append((n-1)%26)
        n = (n-1) // 26
    return "".join(map(lambda x: chr(x+ord('a')), reversed(ans)))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(N))

def test():
    import doctest
    doctest.testmod()

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

Submission status: Accepted

Solution code:
import string
import sys


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


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


n = I()
m = 1
i = 0

print(n_to_alp(n).lower())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

arr = []

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

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

# print(arr)

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

Submission status: Accepted

Solution code:
n=int(input())
x=26
l=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
r=[]
while n > 0:
    r.append(l[n%x-1])
    n=int((n-1)/x)
r=r[::-1]
print("".join(r))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


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


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


print(dogname(N))

Submission status: Accepted

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

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

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

print(al)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A = "abcdefghijklmnopqrstuvwxyz"

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

n = I()
s = "abcdefghijklmnopqrstuvwxyz"

val = [-1]*100

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

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

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

Submission status: Accepted

Solution code:
n = int(input())


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

    else:
        buf.append(n)
        break
# print(buf)
buf.reverse()
# print(buf)

ans = ""
for b in buf:
    if b == 0:
        ans += chr(26 + 96)
    else:
        ans += chr(b+96)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import string

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

resolve()

Submission status: Accepted

Solution code:
n=int(input())
# dic={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',26:'z'}
def baseto26(num):

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

Submission status: Accepted

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

abc='abcdefghijklmnopqrstuvwxyz'

n=int(input())

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

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

  n//=26

#  print(ans[::-1],n)

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
key=num2alpha(N)
print(str.lower(key))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

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

n = int(input()) - 1

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

Submission status: Accepted

Solution code:
N = int(input())

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

ans = []

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



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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

num2alpha = lambda c: chr(c+96)

ans = ""

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


def num2alpha(n):
    if n <= 26:
        return chr(96+n)
    elif n % 26 == 0:
        return num2alpha(n//26-1)+chr(122)
    else:
        return num2alpha(n//26)+chr(96+n % 26)


print(num2alpha(n))

Submission status: Accepted

Solution code:
from sys import stdin
from decimal import Decimal

def main():

    input = stdin.readline

    N = int(input())

    alphabet = "abcdefghijklmnopqrstuvwxyz"

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

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

        N = (N-1) // 26

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(name[::-1])

Submission status: Accepted

Solution code:
import numpy as np

CHAR = "abcdefghijklmnopqrstuvwxyz"

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

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

Submission status: Accepted

Solution code:
n = int(input())
#アルファベットのリスト
l = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
#文字格納
j = []

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

print(''.join(j))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

abclist = list('abcdefghijklmnopqrstuvwxyz')

N = int(input())


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

    mod = N % 26

    N = N // 26

    vals.append(mod)

    strs.append(abclist[mod])

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

Submission status: Accepted

Solution code:
cha='abcdefghijklmnopqrstuvwxyz'
dig=[]
N=int(input())
d=0
n=0
ls=[]
while n<=N:
  n+=(26**d)
  ls.append(n)
  d+=1
# print(d,n,ls)
N-=n
n=N
for _ in range(d-1):
  dig.append(n%26)
  n//=26
ans=[]
for i in range(len(dig)):
  ans.append(cha[dig[i]])
ans.reverse()
print(*ans,sep='')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
lis = []
while n != 0:
    if n%26 == 0:
        lis.append(int(0))
        n -= 26
        n /= 26
    else:
        lis.append(int(n%26))
        n -= n%26
        n /= 26
alp = ["z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"]
st = ""
for i in range(len(lis),0,-1):
    st += alp[lis[i-1]]
print(st)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

Alphabet = "abcdefghijklmnopqrstuvwxyz"

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

result = ""

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

print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys
import math
n =int(input())

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

def alphabet_decimal(v):
    quotient = math.floor(v / len(ALPHABET))
    surplus = v % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < v:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

print(alphabet_decimal(n))

Submission status: Accepted

Solution code:
N = int(input())

name = []

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


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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ls=list("abcdefghijklmnopqrstuvwxyz")

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

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

n = INT()
m = Base_10_to_n(n, 26)
#print(m)
m = [i - 1 for i in m]
#print(m)
for i in reversed(range(1, len(m))):
    if m[i] < 0:
        m[i] += 26
        m[i - 1] -= 1
#print(m)
strt = 0
for i in range(len(m)):
    if m[i] < 0:
        strt = i + 1
    else:
        break
ans = ''
for i in m[strt:]:
    ans += chr(ord('a') + i)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = [0]*(i)

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

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

Submission status: Accepted

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

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

name_rev = []

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

# P = 0
# for i, c in enumerate(name_rev, start=0):
#     P += 26**i * rev[c]
# print(P)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

while N != 0:
    temp = N % 26

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

print("".join(reversed(result)))

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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