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

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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']
 
b = int(input())
r = ''
while b > 0:
  b -= 1
  c = b % len(a)
  r = a[c] + r
  b = int(b / len(a))
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = ""
li = "abcdefghijklmnopqrstuvwxyz"

while N > 0:
    N -= 1
    ans += li[N % 26]
    N //= 26

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    from string import ascii_lowercase
    N = int(input())

    ans = []
    while N > 0:
        N -= 1
        N, i = divmod(N, 26)
        ans.append(ascii_lowercase[i])

    ans = ''.join(reversed(ans))

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())

abc='abcdefghijklmnopqrstuvwxyz'

ans=''
while n!=0:
  q=n%26
  ans+=abc[q-1]

  if q==0:
    n-=1

  n//=26

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())
name = ''
while N!=0:
  N -= 1
  name =  chr(ord('a')+N%26) + name
  N = N//26
print(name)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
n = ni()
alp = "abcdefghijklmnopqrstuvwxyz"
ans = ""

while True:
    n-=1
    r =  n%26
    ans=  alp[r] +ans
    n //= 26

    if n==0:break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
alp = "abcdefghijklmnopqrstuvwxyz"
name = ""
while n > 0:
    name += alp[n%26-1]
    n = (n-1)//26
print(name[::-1])

Submission status: Accepted

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N = I()

ans = ""
for i in range(1,100):
    n = 26**i
    if N > n:
        N -= 26**i
        continue

    N = N - 1
    for j in range(i):
        x,y = divmod(N, 26)
        ans += chr(ord('a') + y)
        N = N //26
    break
    
print(ans[::-1])

Submission status: Accepted

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

    string = ""
    i = 0
    while n > 0: 
        rem = n % 26
        if rem == 0: 
            string += 'z'
            i += 1
            n = (n // 26) - 1
        else: 
            string += str(chr((rem - 1) + ord('a')))
            i += 1
            n = n // 26
    string = string[::-1] 
    print(string)

solve(n)

Submission status: Accepted

Solution code:
n = int(input())
mod = 26

i= 0
name = ''
while n>0:
    n -= 1
    name += chr(ord('a')+n%mod)
    n //= mod


print(name[::-1])

Submission status: Accepted

Solution code:
n = int(input())
name = []
while n:
	n-=1
	name.append(chr(97 + (n%26)))
	n//=26
name.reverse()
print(''.join(name))

Submission status: Accepted

Solution code:
import copy
n=int(input())
n_copy1=copy.copy(n)
n_copy2=copy.copy(n)
alfabet=list("abcdefghijklmnopqrstuvwxyz")
ans=[]
i=0
while n_copy1>0:
    i+=1
    n_copy1-=26**i
n_copy2=n_copy2-(26**i-1)//25
for i in range(i):
    ans.append(alfabet[n_copy2%26])
    n_copy2=n_copy2//26
print("".join(ans[::-1]))

Submission status: Accepted

Solution code:
n = int(input())

m = {}
for i in range(0,26):
  m[i] = chr(97+i)

ans = ''
while 1:

  n -= 1

  x = n // 26
  y = n % 26

  ans = m[y] + ans

  n = x
  if n == 0:
    break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = ""

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

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

ans = ""
while n:
    n -= 1
    ans = chr(97 + n % 26) + ans
    n //= 26

print(ans)

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  k = 1
  while N>pow(26,k):
    N -= pow(26,k)
    k += 1
  ans = ''
  N -= 1
  for i in range(k,1,-1):
    ans += chr(ord('a')+N//pow(26,i-1))
    N%=pow(26,i-1)
  ans += chr(ord('a')+N%26)
  return ans
print(solve())

Submission status: Accepted

Solution code:
def II(): return int(input())
N=II()
N-=1
i=1
ans=''
while N-26**i>=0:
  N-=26**i
  i+=1
for j in range(i):
  div,mod=divmod(N,26)
  ans+=chr(mod+ord('a'))
  N=div
ans=ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
ans = ""
while n > 0:
    m = n%26
    nya = m-1 if m-1 >= 0 else 25
    ans += chr(ord('a') + nya)
    n -= nya
    n //= 26
print(ans[::-1])

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  k = 1
  while N>pow(26,k):
    N -= pow(26,k)
    k += 1
  ans = ''
  N -= 1
  for i in range(k,0,-1):
    if i>1:
      ans += chr(ord('a')+N//pow(26,i-1))
    else:
      ans += chr(ord('a')+N%pow(26,i))
    N%=pow(26,i-1)
  return ans
print(solve())

Submission status: Accepted

Solution code:
D = {i:chr(96+i) for i in range(1,27)}
N = int(input())
A = []
while N>0:
    a = N%26
    if a==0:
        a = 26
        A.append(D[26])
    else:
        A.append(D[a])
    N = (N-a)//26
A = A[::-1]
print("".join(A))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N = ini()


def solve():
    k = 26
    a = 0
    l = 1
    while a + k < N:
        a += k
        k *= 26
        l += 1
    m = N - a - 1
    s = [None] * l
    for i in range(l):
        d = m % 26
        s[i] = chr(ord("a") + d)
        m //= 26
    return "".join(reversed(s))


print(solve())

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque, Counter
import math
 
# import copy
from bisect import bisect_left, bisect_right
# import heapq
 
# sys.setrecursionlimit(1000000)
 
# input aliases
input = sys.stdin.readline
 
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]
 
INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def getmoji(k):
    return chr(ord("a") + k)

def main():
    # print("start")
    n = getN()
    # print(n)
    n -= 1
    ans = []
    while(n>=0):
        ans.append(getmoji(n % 26))
        n //= 26
        n -= 1
        # print(n)?
    ans.reverse()
    print("".join(ans))



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
x = [chr(i) for i in range(ord("a"), ord("z")+1)]
ans = []
while n > 26:
    ans.append(x[n%26-1])
    if n%26 == 0:
        n = n//26-1
    else: n //= 26
ans.append(x[n-1])
print("".join(ans[::-1]))

Submission status: Accepted

Solution code:
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


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

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


def main():
    n=int(input())
    ar=[]
    while(n>0):
        n-=1
        ar.append(n%26)
        n//=26
    ar=ar[::-1]
    for i in ar:
        v=97+i
        print(chr(v),end='')
















BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a = int(input())
s = []
ret = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
       'w', 'x', 'y', 'z',
       ]
while a > 0:
    a -= 1  # 为甚么减去1？
    shang = int(a / 26)
    yushu = int(a % 26)
    # print(shang, yushu)
    s.append(yushu)  # 上面减去的1，加在了这里，由此可以得到1-26，位置信息
    a = shang

s.reverse()
# print(s)
v = ''
for i in range(len(s)):
    v += ret[s[i]]
print(v)

Submission status: Accepted

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

s.reverse()
# print(s)
v = ''
for i in range(len(s)):
    v += ret[s[i]]
print(v)

Submission status: Accepted

Solution code:
s = raw_input()
n = int(s)

def main(n):
	d = 1
	n -= 1
	while n - 26**d >= 0:
		n -= 26**d
		d += 1
	ret = ''
	for i in range(d):
		ret += chr((n%26)+ord('a'))
		n //= 26
	return ret[::-1]

print main(n)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
q = int(input())
ans = ""
 
# 左から埋める
while True:
  q, mod = divmod(q, 26)

  if mod == 0:
    mod = 26
    q -= 1
 
  num2alpha = lambda c: chr(c + 96)
  ans = num2alpha(mod) + ans
 
  if q == 0:
    break
 
print(ans)

Submission status: Accepted

Solution code:
def II(): return int(input())
ans=''
N=II()
N-=1
i=1
while N-26**i>=0:  
  N-=26**i
  i+=1#26のべき乗倍を引いてからインクリメント
for j in range(i):
  div,mod=divmod(N,26)
  ans+=chr(mod+ord('a'))
  N=div
ans=ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
def II(): return int(input())
ans=''
N=II()
N-=1
i=1
while N-26**i>=0:  
  N-=26**i
  i+=1#26のべき乗倍を引いてからインクリメント
for j in range(i):
  mod=N%26
  ans+=chr(mod+ord('a'))
  N//=26
ans=ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
len = 0

for i in range(12):
  if (26**i - 1)//25 <= N and (26**(i+1) - 1)//25 > N:
    len = i
    
ans = ["a" for _ in range(len)]
k = N - (26**len - 1)//25 + 1
x = k-1

for j in range(len):
  ans[j] = chr(ord("a") + x%26)
  x = x // 26

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

Submission status: Accepted

Solution code:
n = int(input())

n -= 1

a = []
while True:
  a.append(n % 26)
  n //= 26
  if not n:
    break
  n -= 1
name = ''.join([chr(ord('a') + c) for c in a])
print(name[::-1])

Submission status: Accepted

Solution code:
n = int(input())

name1 = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
name = ""
while n != 0:
    name = name1[(n%26)-1] + name
    n = (n-1) // 26

print(name)

Submission status: Accepted

Solution code:
num = 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(num).lower())

Submission status: Accepted

Solution code:
import string


def m():
    N = int(input())
    a2z = string.ascii_lowercase
    ans = ''
    while N != 0:
        N -= 1
        ans = a2z[N % 26] + ans
        N = N // 26
    return ans

print(m())

Submission status: Accepted

Solution code:
N = int(input())
ans = []
while N:
    N = N -1
    ans.insert(0, N % 26)
    N = N // 26

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

Submission status: Accepted

Solution code:
n = int(input())-1
q = []
while n >= 0:
    q.insert(0,n % 26)
    n = n // 26-1
ans = ''
for i in q:
    ans += chr(ord('a') + i)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = ""
while(N > 0):
    N -= 1
    ch = N % 26
    ans = chr(97 + ch) + ans
    N //= 26
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

name = ''

while N:
    N -= 1
    mod = N % 26
    name = chr(mod + ord('a')) + name
    N //= 26

print(name)

Submission status: Accepted

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

#あまりが0になった時にaになるようにする。そうしないと最後の方で狂う。
for i in range(1,15):
    if n <= 26 ** i:
        n -= 1
        for j in range(i):
            ans += (chr(n % 26 + 97))
            n //= 26
        break
    n -= 26 ** i

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = 1
while n-26**l > 0:
    n -= 26**l
    l += 1
else:
    n -= 1
    res = ""
    for i in range(l):
        n,r = divmod(n,26)
        res += chr(ord("a")+r)
    ans = res[::-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import collections
import random

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

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

def dist(x1,y1,x2,y2):
	return abs(x1-x2)+abs(y1-y2)

def main():
	N = int(input())
	#vS = [input().rstrip() for _ in [0,]*N]
	oA = ord("a")
	vD = [chr(i+oA) for i in range(26)]
	#vD += [".","#"]

	res = ""
	while N:
		#print(N, N%26, (N-1)%26)###
		res += vD[(N-1)%26]
		N -= 1
		N //= 26
	
	print(res[::-1])
	#sT = "No Yes".split()
	#print(sT[res])
	

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 = []
while N:
    N -= 1
    N, r = divmod(N, 26)
    ans.append(chr(ord('a') + r))
print("".join(reversed(ans)))

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

Solution code:
n = int(input())
n -= 1
name = []
while n >= 0:
    modulo = n % 26
    name += chr(ord("a")+modulo)
    #print (modulo)
    #print (n // 26-1)
    n = n // 26 - 1
print ("".join(reversed(name)))

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()

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

    n -= 1
    r = []
    for j in range(i):
        r.append(chr(ord('a') + n % 26))
        n //= 26

    return JA(r[::-1], '')


print(main())

Submission status: Accepted

Solution code:

def q3():
    Alphabet = ["dummy"] + [c for c in "abcdefghijklmnopqrstuvwxyz"]

    n = int(input())

    name = ""
    while True:
        if n <= 26:
            name = Alphabet[n] + name
            break
        n_c = n % 26
        if n_c == 0:
            name = "z" + name
            n = n // 26 - 1
        else:
            name = Alphabet[n_c] + name
            n = (n - n_c) // 26

    print(name)


q3()

Submission status: Accepted

Solution code:
q = int(input())
ans = ''
alphabet = 'zabcdefghijklmnopqrstuvwxy'
while True:
    r = q%26
    q = q//26 - 1 if r==0 else q//26
    ans =  alphabet[r]+ans
    if q<=0:
        break
print(ans)

Submission status: Accepted

Solution code:
q = int(input())
ans = ''
alphabet = 'zabcdefghijklmnopqrstuvwxy'
while True:
    r = q%26
    q = q//26 - 1 if r==0 else q//26
    ans = ans + alphabet[r]
    if q<=0:
        break
ans = ans[::-1]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

dog_al = ''

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

print(dog_al[::-1])

Submission status: Accepted

Solution code:
n = int(input())
li = [chr(i) for i in range(ord('a'), ord('z') + 1)]
result=[]
n = n - 1

while True:
    s, t = n//26, n%26
    result.append(li[t])
    if s == 0:
        result = result[::-1]
        print("".join(result))
        break
    else:
        n = s-1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
l = int(N**(1/26))
name = ''
while N >0:
    N -= 1
    r = N%26
    N = N//26
    name += chr(ord('a')+r)
print(name[::-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())
ans = []
alpha = [chr(i) for i in range(97, 97+26)]
num = 0
rank = 0

for i in range(100):
    if num >= n:
        rank = i
        break

    num += 26 ** (i + 1)

num -= 26 ** rank
n -= num + 1
for i in range(rank):
    ans.append(alpha[n % 26])
    n = n // 26

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

Submission status: Accepted

Solution code:
def alpha(n):
    if n<=26:
        return chr(96+n)
    elif n%26==0:
        return alpha(n//26-1)+chr(122)
    else:
        return alpha(n//26)+chr(96+n%26)
n=int(input())
print(alpha(n))

Submission status: Accepted

Solution code:
N = int(input())
q = [0]*13
i = 10
n = N
cflag = 0
zflag = 0
str = []
while i != -1:
    q[i] = n // 26 ** i
    mod = n % 26 ** i
    n = mod
    i -= 1
for i in range(12):
    if q[i] == 0:
        zflag = 1
        for j in range(i,13) :
            if q[j] != 0:
                zflag = 0
                break
        if zflag == 1:
             break
        elif cflag == 1:
            str.append("y")
            cflag = 1
        else:
            str.append("z")
            cflag = 1
    elif q[i] == 1 and cflag == 1:
        zflag = 1
        for j in range(i+1,13):
            if q[j] != 0:
                zflag = 0
                break
        if zflag == 1:
            break
        else:
            str.append ("z")
            cflag = 1
    else:
        str.append(chr(q[i] + 96 -cflag))
        cflag = 0

i = len(str) -1
while i >= 0:
    if[str] == '':
        i-=1
        continue
    elif i == 0:
        print(str[i])
        break
    else:
        print(str[i], end="")
        i -= 1

Submission status: Accepted

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

for _ in range(10**5):
	N-=1
	ans+=chr(ord("a")+(N%26))
	N=N//26
	if N<=0:
		break

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

name = ''
while True:
  rem = (N-1) % 26
  name += chr(rem + ord('a'))
  N = (N-1) // 26
  if N == 0:
    break

print(name[::-1])

Submission status: Accepted

Solution code:
n = int(input())
stock = [chr(i) for i in range(97, 97 + 26)]
full, count, j = 26, 1, 1
while (count + full <= n):
    count += full;    j += 1;    full *= 26
q = n - count
s = []
for k in range(j):
    s.append(stock[q % 26])
    q //= 26
print("".join(s[::-1]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s='zabcdefghijklmnopqrstuvwxy'
a=''
while(int(n)>0):
        t=n%26
        if t==0:
            n-=26
        a=s[t]+a
        n=n//26
print(a)

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

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

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
# 自力では解けなかった(2020.7.6)

alpha = ['Z']
alpha.extend([chr(ord('a') + i) for i in range(26)])
N = int(input())
q = N
ans = ''
while True:
    if q <= 26:
        ans += str(alpha[q])
        break
    else:
        q, mod = divmod(q, 26)
        if mod == 0:
            q -= 1
            mod = 26
        ans += str(alpha[mod])

print(ans[::-1])

Submission status: Accepted

Solution code:
import sys
n = int(sys.stdin.readline())
ans = ""
x = n
while n >= 26:
  n, mod = divmod (n-1, 26)
  ans =  chr(ord("a") + mod) + ans
if n != 0:
  ans =  chr(ord("a") + n - 1) + ans
print (ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
ls = "abcdefghijklmnopqrstuvwxyz"
cnt = 0
base = 26
while n >= base ** cnt:
    n -= base ** cnt
    cnt += 1
ans = ""
#print(cnt, n)
for i in range(cnt-1, -1, -1):
    res = n // (base ** i)
    ans += ls[res]
    n -= base ** i * res
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())

ans = ""
while n >= 26:
  n, mod = divmod(n-1, 26)
  ans = chr(ord("a")+mod) + ans
if n != 0:
  ans = chr(ord("a")+n-1) + ans

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
def II(): return int(input())
N=II()
N-=1
i=1
while N>=(26**i):
  N-=26**i
  i+=1
ans=''
for j in range(i):
  q,mod=divmod(N,26)
  ans=ans+chr(mod+ord('a'))
  N=q
ans=ans[::-1]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(1, 100):
    if N<=26**i:
        ans = ''
        N -= 1
        
        for j in range(i):
            ans += chr(ord('a')+N%26)
            N //= 26
            
        break
    else:
        N -= 26**i

print(ans[::-1])

Submission status: Accepted

Solution code:
N=int(input())
ans=''
for i in range(1,99):
    if N<=26**i:
        N-=1 #０インデックス使う方がやりやすい？から−１してるそのままなら下のchr(ord('a'))を一つ前の文字にすればいい
        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())
import math

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

Submission status: Accepted

Solution code:
n=int(input())
ans=[]
b=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
num=0
keta=0
for i in range(100):
    if num >= n:
        keta = i
        break
    num = 26**(i+1)+num
num  = num - 26**keta
n = n - num -1 
for i in range(keta):
    ans.append(b[n%26])
    n=n//26
ans.reverse()
print(''.join(ans))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())

name = ""

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

while(N > 26) :
  m = N%26
  name = num2char(m) + name
  N = int(N/26)
  if m == 0 :
    N -= 1
  
name = num2char(N) + name
print(name)

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