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

Submission status: Accepted

Solution code:
N = int(input())
keta = 1
now = 0
while now+pow(26,keta) < N:
    now += pow(26,keta)
    keta += 1
ans = ""
while keta:
    for i in range(1,27):
        if N <= now+pow(26,keta-1)*i:
            now += pow(26,keta-1)*(i-1)
            ans += chr(ord('a')+i-1)
            break
    keta -= 1
print(ans)

Submission status: Accepted

Solution code:
arphaList = 'abcdefghijklmnopqrstuvwxyz'
result = ""
N = int(input())

while N != 0:
  arpha = arphaList[(N + 25) % 26]
  result += arpha
  N = N // 26
  if arpha == "z":
    N -= 1
print(result[::-1])

Submission status: Accepted

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

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 > 0:
    n -= 1
    ans += chr(97 + n % 26)
    n //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
n=int(input())
# n=26*26+26+1
basis=[26**i for i in range(12)]
l=[]
s=0
for b in basis:
    s+=b
    l.append(s)    

i=0
f=12
while(f-i>1):
#     print(f-i)
    x=(i+f)//2
    if l[x]>n:
        f=x
    else:
        i=x

length=i+1
k=n-(l[length-1]-1)
x=k-1
res=[]
for i in range(length):
    q=x//26
    r=x%26
    x=q
    res.append(r)

ans=list(map(lambda x: chr(ord("a")+x),list(reversed(res))))
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = 0
ans = ''
for i in range(1,15):
    if N <= A + 26 ** i:
        l = i
        break
    A += 26**i

M = N - A - 1

for i in range(l):
    c = M % 26
    M //= 26
    ans += chr(ord('a') + c)

print(ans[::-1])

Submission status: Accepted

Solution code:
import sys
import math
#input=sys.stdin.buffer.readline  
t=1
#t=int(input())
for _ in range(t):
    n=int(input())
    #n,c=map(int,input().split())
    suma=0
    length=0
    mul=1
    ans=[]
    while n>0:
        n-=1
        ans.append(chr(n%26+97))
        n//=26
    print(*ans[::-1],sep="")

Submission status: Accepted

Solution code:
n = int(input())

ans = ''
while n > 0:
    n -= 1
    n, mod = divmod(n, 26)
    ans += chr(ord('a') + mod)
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

ans = ''
while n > 0:
    n -= 1
    a = n % 26
    ans += chr(ord('a') + a)
    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:
import sys
sys.setrecursionlimit(10 ** 9)

convert = {
    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 Base_n_to_10(X, n):
    if (int(X/n)):
        return Base_n_to_10(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
    r = []
    n = int(input())
    while True:
        n -= 1
        r.append(n % 26)
        n = n // 26
        if n == 0: break
    for i in r[::-1]:
        print(convert[i+1], end='')
    print()
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def to_n(x,n,cnt):
    ans=[]
    for _ in range(cnt):
        ans.append(x%n)
        x//=n
    return ans[::-1]

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())

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

    tmp=26
    cnt=1
    while n>tmp:
        n-=tmp
        tmp*=26
        cnt+=1
    
    n-=1
    m=to_n(n,26,cnt)
    ans="".join([alp[m[i]] for i in range(len(m))])
    print(ans)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
digits = 0
for i in range(1, 12):
    cnt += pow(26, i)
    if n <= cnt:
        digits = i
        break

k = n - cnt + pow(26, digits) - 1
#digits桁の中で何番目か

alf = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

for i in range(digits):
    q = k // 26
    r = k%26
    ans = alf[r] + ans
    k = q
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

basis=[26**i for i in range(12)]
l=[]
s=0
for b in basis:
    s+=b
    l.append(s)    

i=0
f=12
while(f-i>1):
#     print(f-i)
    x=(i+f)//2
    if l[x]>n:
        f=x
    else:
        i=x

k=n-l[i]
length=i+1

res=[]
for i in range(length):
    q=k//26
    r=k%26
    k=q
    res.append(r)

ans=list(map(lambda x: chr(ord("a")+x),list(reversed(res))))
print("".join(ans))

Submission status: Accepted

Solution code:
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

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

Submission status: Accepted

Solution code:
N = int(input())
moji =  ''
while True:
    if N % 26 == 0:
        moji = 'z' + moji
        N = N // 26 - 1
    elif N % 26 > 0 and N % 26 < 10:
        moji = chr(ord(str(N % 26)) + 48) + moji
        N //= 26
    elif N % 26 > 9 and N % 26 < 20:
        moji = chr(ord(str(N % 26 - 10)) + 58) + moji
        N //= 26
    else:
        moji = chr(ord(str(N % 26 - 20)) + 68) + moji
        N //= 26

    if N == 0:
        break
print(moji)

Submission status: Accepted

Solution code:
n = int(input())

cnt = 1

ans = []

while n>0:
    n -= 1
    x = n%(26)
    ans.append(chr(x+97))
    n = n//26
    cnt += 1
    
ans.reverse()

for i in ans:
    print(i,end= "")

Submission status: Accepted

Solution code:
n = int(input())
alf = [chr(i) for i in range(97, 97+26)]
ans = ''
while(n != 0):
    a = n % 26
    if a == 0:
        a = 26
    ans = alf[a-1] + ans
    n = (n - a)//26
print(ans)

Submission status: Accepted

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

for i in range(1, 30):
    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())
ans = ''
for l in range(1, 99):
    if n <= 26 ** l:
        n -= 1
        for _ in range(l):
            ans += chr(ord('a') + n % 26)
            n //= 26
        break
    else:
        n -= 26 ** l
print(ans[::-1])

Submission status: Accepted

Solution code:
def to_n(x,n):
    ans=[]
    if x==0:
        return [0]
    while x>0:
        x-=1
        ans.append(x%n)
        x//=n
    return ans[::-1]

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())

    alp=[chr(i) for i in range(97,97+26)]
    m=to_n(n,26)
    ans=[alp[m[i]] for i in range(len(m))]
    print("".join(ans))

if __name__=="__main__":
    main()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

x = 1
leng = 0

while True:
    if n-x < 0: break
    n -= x
    leng += 1
    x *= 26

ans = ["a"] * leng

for i in range(leng):
    ans[i] = chr(n % 26 + ord("a"))
    n //= 26

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
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())
ans=str()
while(n>0):
    n=n-1
    k=n%26
    ans=chr(ord('a')+k)+ans
    n//=26
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
abc=[chr(i) for i in range(97, 97+26)]
ans=""
while N>0:
    N-=1
    ans+=(abc[N%26])
    N//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
res = ""
while N:
  N -= 1
  res += chr(N % 26 + ord("a"))
  N //= 26
print(res[: : -1])

Submission status: Accepted

Solution code:
from string import ascii_lowercase


def calc_name_length(N: int) -> int:
    name_length: int = 0
    total: int = 0

    for i in range(1, 12):
        total += 26 ** i
        if N <= total:
            name_length = i
            break

    return name_length


def calc_name_number(N: int, name_length: int) -> int:
    total: int = 0

    for i in range(1, name_length):
        total += 26 ** i

    N = N - (total + 1)

    return N


def calc_name(name_length: int, name_number: int) -> str:
    name: str = ""

    for _ in range(name_length):
        name += ascii_lowercase[name_number % 26]
        name_number //= 26

    return name


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

    name_length: int = calc_name_length(N)
    name_number: int = calc_name_number(N, name_length)
    name: str = calc_name(name_length, name_number)

    print(name[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
name = ""
for i in range(20):
    N -= 1
    N_mod = N % 26
    N_div = N // 26
    Nmod_to_alp = chr(N_mod+ord("a"))
    name = Nmod_to_alp + name
    if N_div == 0:
        break
    else:
        N = N_div
print(name)

Submission status: Accepted

Solution code:
n = int(input())
result = ''


def rec(n, result):
    q, mod = divmod(n, 26)

    if q == 0:
        if mod != 0:
            result += chr(mod + 96)
        return result

    if mod == 0:
        result += 'z'
        q = q - 1
    else:
        result += chr(mod + 96)

    n = q
    return rec(n, result)


result = rec(n, result)
print(result[::-1])

Submission status: Accepted

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

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

while n > 0:
    k = n - 1
    rem = k % 26
    ans = alphabet[rem] + ans
    n = k // 26



print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = []
while n > 0:
    n -= 1
    a.append(n%26)
    n = n // 26
ans = ""
for i in range(len(a)):
    ans += chr(ord("a")+a[(-1)*(i+1)])
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:
# ABC171C

def dog(n):
    abc = 'abcdefghijklmnopqrstuvwxyz'
    n -= 1
    pow = [0]
    cum = 0
    for i in range(1, 12):
        cum += 26**i
        pow.append(cum)
    for i in range(1, 12):
        if pow[i - 1] <= n <  pow[i]:
            break
    # print(i, pow[i-1], n, pow[i])
    dig = []
    n = n - pow[i - 1]
    # print(n)
    for j in range(i):
        n2 = n // 26
        dig.append(n % 26)
        n = n2
    str = [abc[i] for i in reversed(dig)]
    str = ''.join(str)
    print(str)

n = int(input())
dog(n)

Submission status: Accepted

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


def base_10_to_n(X, n):
    ans = []

    while X > 0:
        X -= 1
        ans.insert(0, X % n)
        X //= n

    return ans


def main():
    N = int(input())
    n26 = base_10_to_n(N, 26)

    ans = []

    for n in n26:
        ans.append(chr(97 + int(n)))
    
    print("".join(ans))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

x = 26

ans = ""
while n:
    n -= 1
    ans += chr(ord("a") + (n % x))
    n //= x

print(ans[::-1])

Submission status: Accepted

Solution code:
N=int(input())
alphabet=[chr(i) for i in range(97,123)]
ans=""
while N>0:
    N-=1
    ans=chr(97+(N%26))+ans
    N//=26
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

Ans = []
while N > 0:
    N -= 1
    Ans.append(chr(97 + N % 26))
    N //= 26
print(''.join(Ans[::-1]))

Submission status: Accepted

Solution code:
def main():
    alphabet = list(chr(i)for i in range(97, 123))
    n = int(input())
    ans = ''
    while n > 0:
        n -= 1
        ans = chr(ord('a') + (n % 26)) + ans
        n = n//26

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

data = ["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"]

q, mod = divmod(n-1, 26)
answer = data[mod]

while q >= 1:
    q, mod = divmod(q-1, 26)
    answer = data[mod] + answer

print(answer)

Submission status: Accepted

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

S = 1
i = 0
Sum = 0
while Sum<N:
    S *= 26
    Sum += S
    i = i+1


ans = []
for j in range(i):
    N -= 1
    r = N%26
    ans.insert(0, name[r])
    N = N//26

ans = ''.join(ans)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

ans = ''
while n:
    x = n % 26
    if x != 0:
        ans += chr(x+96)
    else:
        ans += 'z'
        n -= 1
    n //= 26

print(ans[::-1])

Submission status: Accepted

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

def II(): return int(input())
def MII(): return map(int, input().split())
def LII(): return list(map(int, input().split()))

def main():
    N = II()

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

    print(ans[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
kigou=list("abcdefghijklmnopqrstuvwxyz")
a=int(input())
keta=0
count=0
for i in range(1,100):
    x=26**i+count
    if 26**i+count>=a:
      keta=i
      break
    else:
        count+=26**i

ans=""

for i in range(keta):
    r=(a-1)%26
    ans=kigou[r]+ans
    a=(a-r)//26

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)
      
print(num2alpha(n).lower())

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
while n:
  n -= 1
  alphabet = chr(ord('a') + n % 26)
  ans += alphabet
  n //= 26
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:
M = 100
po = [26 ** i for i in range(M)]

N = int(input())

L = 0
for i in range(M):
    if N < po[i]:
        L = i
        break
    N -= po[i]

ans = ""
for i in range(L):
    ans += chr(ord('a') + N // po[L - (i + 1)])
    N %= po[L - (i + 1)]

print(ans)

Submission status: Accepted

Solution code:
import os
with open('dc_no_koodo.jpg.exe','w') as f:
  f.write(f'{input()}[1-26~rd0<fr97+P]dsfx')
os.system('dc < dc_no_koodo.jpg.exe')

Submission status: Accepted

Solution code:
#abc171c
n=int(input())
s=''
while n:
 n-=1
 s+=chr(n%26+97)
 n//=26
print(s[::-1])

Submission status: Accepted

Solution code:
N = int(input())
count = 0
ans = list()
r = 0
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']
d = -1


while N > 26**count + d:
    count+=1
    d = 26**(count-1) + d

#print(count)
count = count - 1
count2 = count

while count > 0:
    #print(N)
    N = N - 26**count
    #print(N)
    count = count - 1

#print(N)
#print(N)
N = N - 1
#print(N)
A = 1
while N > 0:
    A = N // 26
    B = N % 26
    #print(ans)
    ans.append(B)
    #print(ans)
    N = A

#print(ans)
#print(len(ans))
#print(count2+1)

while len(ans) < count2 + 1:
    ans.append(0)
    #print(len(ans))

#print(N)
#print(len(ans))
#print(ans)
ans.reverse()
#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

#print(ans)

print(''.join(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    n = ri()
    n -= 1
    out = ""
    while n >= 0:
        n, r = divmod(n, 26)
        n -= 1
        out = chr(ord('a') + r) + out
    print (out)






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Submission status: Accepted

Solution code:
n = int(input())
ans = ''
for i in range(1, 99):
    if n <= 26 ** i:
        n -= 1
        for _ in range(i):
            ans += chr(ord('a') + n % 26)
            n //= 26
        break
    else:
        n -= 26 ** i
print(ans[::-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()
	ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
	soezi = [i for i in range(26)]
	soezi = [26] + soezi

	ans = ""
	tmp = N
	while True:
		if tmp == 0:
			break
		tmp2 = tmp % 26
		ans = ascii_lowercase[tmp2-1] + ans

		tmp = tmp - soezi[tmp2]
		tmp = tmp // 26

	print(ans)



#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
# Implementation by unihernandez22 || Idea by Vicfred
# https://atcoder.jp/contests/abc171/tasks/abc171_c
# math, greedy

n = int(input())

digits = []

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

print(''.join(reversed(digits)))

Submission status: Accepted

Solution code:
N = int(input())
a = list('abcdefghijklmnopqrstuvwxyz')
name = 0
while N!=0:
  N-=1
  M = N%26
  N = N//26
  if name ==0:
    name = a[M]
  else:
    name = a[M]+name

print(name)

Submission status: Accepted

Solution code:
s = 'abcdefghijklmnopqrstuvwxyz'
n = int(input()) - 1
ans = ''
while n > 25:
    ans += s[(n % 26)]
    n = n // 26 - 1
ans += s[n%26]
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:
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:
alp=[chr(i) for i in range(97,123)]
n=int(input())

for i in range(1,12):
    if n>26**i:
        n-=26**i
    else:
        keta=i
        break
#その桁数の名前のなかでn番目
n-=1
lst=[]
#このnを26進数で表し、0~25にa~zをあてはめる
for i in range(keta):
    p,n=divmod(n,26**(keta-i-1))
    lst.append(alp[p])
    
print("".join(lst))

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 string
lc = string.ascii_lowercase
n = int(input())

lst = [0]
for i in range(1, 100000):
    tmp = pow(26, i)
    lst.append(tmp)
    if tmp > n:
        break
cum = [lst[0]]
for i in range(1, len(lst)):
    cum.append(cum[-1] + lst[i])
idx = 0
while True:
    if n-1 < cum[idx]:
        break
    idx += 1
num = n - cum[idx-1] - 1
ans = ''
for i in range(idx)[::-1]:
    tmp = pow(26, i)
    k = num // tmp
    num = num - tmp *k
    ans += lc[k]
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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).lower())


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

Submission status: Accepted

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

ans = []
while n >= 0:
    n, y = divmod(n, 26)
    ans.append(y)
    n -= 1
print(''.join(map(lambda x: chr(x+ord('a')), ans[::-1])))

Submission status: Accepted

Solution code:
def amari(x):
    if x == 0:
        return 'a'
    elif x == 1:
        return 'b'
    elif x == 2:
        return 'c'
    elif x == 3:
        return 'd'
    elif x == 4:
        return 'e'
    elif x == 5:
        return 'f'
    elif x == 6:
        return 'g'
    elif x == 7:
        return 'h'
    elif x == 8:
        return 'i'
    elif x == 9:
        return 'j'
    elif x == 10:
        return 'k'
    elif x == 11:
        return 'l'
    elif x == 12:
        return 'm'
    elif x == 13:
        return 'n'
    elif x == 14:
        return 'o'
    elif x == 15:
        return 'p'
    elif x == 16:
        return 'q'
    elif x == 17:
        return 'r'
    elif x == 18:
        return 's'
    elif x == 19:
        return 't'
    elif x == 20:
        return 'u'
    elif x == 21:
        return 'v'
    elif x == 22:
        return 'w'
    elif x == 23:
        return 'x'
    elif x == 24:
        return 'y'
    elif x == 25:
        return 'z'
    
N = int(input())
K = 0
k = 0
i = 0
my_str = []
while True:
    if  k <= N <= K:
        N = N - k #number in the floor
        for j in range(i): # i=length of the coded name
            my_str.append(amari(N % 26))
            N = N // 26
        strA = ''.join(my_str[::-1])
        print(strA)
        exit()
    else:
        i += 1
        k = K + 1
        K += 26 ** i

Submission status: Accepted

Solution code:
def convert(n):
    tmp = 26 if n % 26 == 0 else n % 26
    if n == tmp:
        return chr(tmp + 64)
    return convert((n - tmp) // 26) + chr(tmp + 64)


N = int(input())
print(convert(N).lower())

Submission status: Accepted

Solution code:
n = int(input())
s_list = [chr(i) for i in range(97, 97+26)]
ans = ''

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

print(ans)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
from decimal import Decimal
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
q,r = 0,0
A =[]
for i in range(15):
    if N < 26:
        r = N
        break
    q = N//26
    r = N%26
    if r == 0:
        q -= 1
        r = 26
    #print(f"{N} = {q} * 26 + {r}")
    A.append(string.ascii_lowercase[r-1])
    #print(A)
    N = q
if r > 0:
    A.append(string.ascii_lowercase[r-1])
print("".join(A[::-1]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
 
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())-1
y = 26
idx = []

c = [chr(i + ord("a")) for i in range(26)]

while True:
    idx.append(n % y)
    n //= y
    if n <= 0:
        break
    n -= 1

idx.reverse()
ans = []
for i in idx:
    ans.append(c[i])
print("".join(ans))

Submission status: Accepted

Solution code:
# [基本方針]
# コンプロでもやった進数変換の応用問題。今回は26進数変換を基本に考える。
# 1:aではなく、0:aを対応していると考える。そのため、26で割ったあまりを考える時、0:a、1:b,..., z:25と考えることができる。
# 計算量はO(logN)

N = int(input())
ans = ''
while N:
    # 1をaではなく、0をaに割り当てると考えるため、N-=1を行う。
    N -= 1

    # ここから下は基本的な進数変換と同じ
    alphabet = chr(ord('a') + N % 26)
    ans += alphabet
    N //= 26
    
# 文字列を反転させる
print(ans[::-1])

Submission status: Accepted

Solution code:
kigou=list("abcdefghijklmnopqrstuvwxyz")
a=int(input())
keta=0
count=0
counter=[0]
for i in range(1,100):
    x=26**i+count
    if 26**i+count>=a:
      keta=i
      counter.append(x)
      break
    else:
        count+=26**i
        counter.append(count)
ans=""

for i in range(keta):
    a -= 1
    ans=kigou[a%26]+ans
    a=a//26

print(ans)

Submission status: Accepted

Solution code:
alp=[chr(i) for i in range(ord("a"),ord("z")+1)]
def main(n):
  ans=""
  while n:
    n-=1
    ans+=alp[n%26]
    n//=26
  return ans[::-1]
n=int(input())
print(main(n))

Submission status: Accepted

Solution code:
n = int(input())-1
x = ''

while True:
    if n < 26:
        x = chr(97+n) + x
        break
    quotient = n//26
    remainder = n%26
    x = chr(97+(remainder))  + x
    n = quotient-1
    
print(x)

Submission status: Accepted

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

ans = ""
N = int(input())
while N > 0:
    tmp = N % 26
    if tmp == 0:
        ans += chr(26+96)
        if N == 26:
            break
        N //= 26
        N -= 1
        
    else:    
        ans += chr(tmp+96)
        N //= 26

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]
    n //= 26

print(ans[::-1])

Submission status: Accepted

Solution code:
digits = "abcdefghijklmnopqrstuvwxyz"

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

while n:
    n -= 1
    m = n%26
    n = n//26
    ans.append(digits[m])

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

Submission status: Accepted

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

    i = 1
    sum = 0
    temp = 0
    while True:
        temp = 0
        i += 1
        sum += 1
        for j in range(1,i):
            temp += 26**j

        if N <= temp:
            break

    #文字数はsum
    temp = 0
    for j in range(1,sum):
        temp += 26**j
    #print(N)
    N -= (temp+1)
    #print(N,sum)

    ans = []
    for j in range(sum):
        amari = N%26
        N = N//26
        #print(amari,flag)
        ans.append(amari)

    ans2 = [0]*len(ans)
    dict = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
    for j in range(sum):
        ans2[sum-1-j] = dict[ans[j]]
    print(''.join(ans2))


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(''.join(reversed(chars)))

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

def main():
    N = int(input())
    keta = 1
    ans = ""
    while 1:
        x = N % (26**keta) // (26**(keta-1))
        if x == 0:
            x = 26
        ans = chr(ord("a") + (x-1)) + ans
        N -= x * (26**(keta-1))
        keta += 1
        if N == 0:
            break
    print(ans)

if __name__ == '__main__':
    main()