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: Runtime Error

Solution code:
table = [0] + [chr(i) for i in range(97, 97+26)]

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = table[X_dumy%n]+out
        X_dumy = int(X_dumy/n)
    return out

print(Base_10_to_n(int(input()),26))

Submission status: Runtime Error

Solution code:
n=int(input())
k=[]
def a(i):
    if i==0:
        return 26
    else:
        return i
while n>26:
    k+=[chr(96+a(n%26))]
    if n%26==0:
        n=n//26-1
    else:
        n//=26
k+=[chr(96+a(n))]
print(z+1,"".join(k[::-1]))

Submission status: Runtime Error

Solution code:
n=int(input())
a='abcdefghijklmnopqrstuvwxyz'
def c(i):
    if i//26:
        return c(i//26)+str(i%26)
    return str(i%26)
m=c(n)
for v1,v2 in zip(m,m[1:]):
    if v1=='0':
        continue
    if v2=='0':
        v=int(v1+v2)
    else:
        v=int(v1)
    print(a[v-1],end='')
print(a[int(m[-1])-1] if not m[-1]=='0' else '')

Submission status: Runtime Error

Solution code:
n = int(input())
res = []
n -= 1
while n != 0:
    res.append(n%26)
    n = n//26
s = ''
res = res[::-1]
for i in range(0,len(res)-1):
    s += chr(res[i]+96)
s += chr(res[-1] + 97)
print(s)

Submission status: Runtime Error

Solution code:
aalphabets = [""] + [s for s in "abcdefghijklmnopqrstuvwxyz"]

s = int(input())

nums = []

while s > 0:
  nums.append((s - 1) % 26 + 1)
  s = (s - 1) // 26

res = ""
  
for _ in range(len(nums)):
  res = res + alphabets[nums.pop()]

print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
str_row = ['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']
result = []

while N > 26:
    r = N % 26
    result.append(str_row[r])
    N = int(N / 26)
result.append(str_row[N])

for i in result[::-1]:
    print(str(i), end='')

Submission status: Runtime Error

Solution code:
n = int(input())
s=[]
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"]
word = []
while n > 0:
    s.append(n % 26)
    n = n // 26
for  m in s:
    if m == 0:
        word.append[z]
    else:
        word.append(alp[m-1])
word.reverse()
print("".join(word))

Submission status: Runtime Error

Solution code:
N = int(input())
T = N
k = 26
c = 0
while(T - k > 0):
    T -= k
    k *= 26
    c += 1

alph = {}
p = 1
for i in range(97, 97+26):
    alph[str(p%26)] = chr(i)
    p += 1
ans = ""
for i in range(c, -1, -1):
    t = N // (26**i)
    ans += alph[str(t)]
    N -= t*(26**i)
print("".join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())-1
x = 26
d = 1
while n > x:
  n -= x
  d += 1
  x *= 26
  
ans = ""
al = list("abcdefghijklmnopqrstuvwxyz")
tmp = pow(26,d)
for i in range(d-1,-1,-1):
  tmp //= 26 
  ans += al[n//tmp]
  n %= tmp
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

S = 'abcdefghijklmnopqrstuvwxyz'

def bite(X):
    s = 0
    t = 0
    while t < X:
        t = t + 26**(s+1)
        s = s + 1
    return s

B = bite(N)
X = N
L = []
for i in range(B-1):
    L.append(X//(26**(B-i-1)))
    X = X - (X//(26**(B-i-1)))*(26**(B-i-1))
L.append(X)

ans = ''
for i in range(B):
    ans = ans + S[L[i]-1]
    
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
lis = [chr(ord('a') + i) for i in range(26)]

m = n
i=1
while True:
    if m <= 26**i:
        break

    else:
        m -= 26**i
        i += 1

ans = []

for j in range(i-1, -1, -1):
    s1 = n // 26**j
    if s1 == 0:
        ans.append(list[s1])
    else:
        ans.append(lis[s1-1])
    n -= (26**j) * s1

print(''.join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())

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

for i in reversed(range(10)):
    if n//(26**i):
        print(al[n//26**i-1], end="")
        n = n%(26**i)

Submission status: Runtime Error

Solution code:
N=int(input())
S='abcdefghijklmnopqrstuvwxyz'
t=Base_10_to_n(N, 26)
for i in t:
    print(S[int(i)-1],end='')

Submission status: Runtime Error

Solution code:
#                           जय श्री राम

import sys; import math; from collections import *
# sys.setrecursionlimit(10**6)

def get_ints(): return map(int, input().split())
def get_list(): return list(get_ints())
def printspx(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")

UGLYMOD = int(1e9+7); SEXYMOD = 998244353; MAXN = int(1e5)

sys.stdin  = open("input.txt","r"); sys.stdout = open("output.txt","w")

# for _testcases_ in range(int(input())):
start =  26
n = int(input())
ans = []
while n:
    ans.append(n%26)
    n //= 26
# print(ans)
ans = ans[::-1]
for i in ans:
    if i == 0:
        i = 26
    printspx(chr(i+ord('a')-1))



'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS MINE @luctivud ( UDIT GUPTA )
Link may be copy-pasted here if it's taken from other source.
DO NOT PLAGIARISE.
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''

Submission status: Runtime Error

Solution code:
n = int(input())
s=[]
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"]
word = []
while n > 0:
    s.append(n % 26)
    n = n // 26
for index, m in enumerate(s):
    if m == 0:
        word.append[z]
    else:
        word.append(alp[m-1])
word.reverse()
L = "".join(word)
print(L)

Submission status: Runtime Error

Solution code:
N = int(input())

i=1
now=26
before = 0
while True:
    if N <= now:
        break
    i += 1
    before = now
    now += 26**i
    
#print(i)
M = N-before
alphabet = "abcdefghijklmnopqrstuvwxyz"
ans=""
for j in range(i):
    dig = int(M//26**(i-j-1))
    #print(dig)
    if j==i-1:
        ans = ans + alphabet[dig-1]
    else:
        ans = ans + alphabet[dig]
        M -= dig*26**(i-j-1)
    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

P = N 
alpha = "abcdefghijklmnopqrstuvwxyz"
ans = ""
for i in reversed(range(0,10)):
    q, mod = divmod(P, 26 ** i)
    P = mod
    if q != 0:
        ans = ans + alpha[q-1]

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
dic_items = {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'}
ans = []
while n != 0:
  ans.append(n%26)
  n = n//26
for i in range(len(ans)):
  print(dic_items[ans[len(ans)-1-i]-1],end='')

Submission status: Runtime Error

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N = INT()

i = 1
while N > 26**i:
	N -= 26**i
	i += 1


ans = ""
for j in range(i-1, 0, -1):
	ans += ascii_lowercase[N//(26**j)]
	N %= 26**j

ans += ascii_lowercase[N-1]

print(ans)

Submission status: Runtime Error

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

ans=""
while N:
    r=(N+26-1)%26
    ans+=chr(ord("a")+r)
    N//=26
ans=list(reversed(ans))

if ans[-1]=="z":
    ans[-1]="a"
else:
    ans[-1] = chr(ord(ans[-1])+1)
print("".join(map(str,ans)))

Submission status: Runtime Error

Solution code:
s=int(input())
alp=list("abcdefghijklmnopqrstuvwxyz")
ans=""
i=0
while 26**i<s:
  i+=1
i-=1
while s!=0:
  x=s//(26**i)
  s-=(26**i)*x
  ans+=alp[x-1]
  i-=1
print(ans)

Submission status: Runtime Error

Solution code:
import math
from decimal import Decimal

N = int(input())

res = ""

alp = "0abcdefghijklmnopqrstuvwxyz"

while N > 0:
    if N > 26:
        
        NN = N//26
        m = N - NN*26
        N = N//26
        # print(alp[m])
        res = alp[m] + res
    else:
        # print(alp[N])
        res = alp[m] + res
        N = 0

print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
lst="abcdefghijklmnopqrstuvwxyz"
ans=""
for i in range(9, 0, -1):
  temp=26**i
  if n//temp>0 and n%temp>0:
    x=n//temp
    ans+=str(lst[x-1])
    n=n%temp
ans+=str(lst[n-1])
print(ans)

Submission status: Runtime Error

Solution code:
def resolve():
    n = int(input())
    flag = 0
    name = []
    if n < 27:
        print(chr(i + 96))
        return
    while n > 0:
        c = n % 26
        name.append(c)
        n //= 26
        if n == 1:
            flag = 1

    print(''.join([chr(i + 96) for i in reversed(name)]))

resolve()

Submission status: Runtime Error

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


ans = []
while n > 0:
    n, y = divmod(n, 26)
    ans.append(y)
ans.reverse()
*x, y = ans


def to_alpha(x):
    if x == 0:
        return 'z'
    else:
        return chr(x+ord('a')-1)


print(''.join(map(to_alpha, x))+chr(y+ord('a')))

Submission status: Runtime Error

Solution code:
import sys

l = sys.stdin.readline().rstrip('\n').split(' ')
N = int(l[0])

digits = 1

while True:
    ub = 26 ** digits
    if N <= ub:
        break
    N -= ub
    digits += 1

ans = ''
N -= 1

for pos in range(digits):
    offset = N % 26
    digit = chr(ord('a') + offset)
    ans = digit + ans
    N /= 26

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = []
while n != 0:
    o = chr(n%26 +96)
    ans.append(o)
    n //= 26
ans = reversed(ans)
print(''.join(ans))n = int(input())
ans = []
while n != 0:
    o = chr(n%26 +96)
    ans.append(o)
    n //= 26
ans = reversed(ans)
print(''.join(ans))

Submission status: Runtime Error

Solution code:
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    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']
    n = ii()
    tmp = 26
    cnt = 1
    while n > tmp:
        n-=tmp
        tmp*=26
        cnt+=1
    cnt-=1
    tmplist = []
    while cnt > 0:
        tmptmp = 26**cnt
        tmplist.append(n//tmptmp)
        n%=tmptmp
        cnt-=1
    tmplist.append(n-1)

    ans = ''
    for i in tmplist:
        ans+=l[i]

    print(ans)



main()

Submission status: Runtime Error

Solution code:
sum=0
N,K=input().split(" ")

array=input().split(" ")
for i in range(int(N)):
  n=int(array[i])
  array[i]=n

array.sort()

for j in range(int(K)):
  sum=sum+array[j]
print(sum)

Submission status: Runtime Error

Solution code:
N=int(input())
n=0
for i in range(1,10):
   if N<=(n+26**i):
       break
   else:
       n+=26**i
#print(i)

N-=n
N-=1
#print(N)
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"]
ans=""
for j in range(i):
    ans+=A[N//(26**(i-1-j))]
    N%=(26**(i-1-j))
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
final = ""
digits = []
temp = N

while temp > 0:
    res = temp%26
    temp //= 26
    digits.append(res)
    
chars = "abcdefghijklmnopqrstuvwxyz"
dic = {i: chars[i] for i in range(26)}
for j in range(len(digits)):
    char = dic[digits[j] - 1]
    final = char + final
print(final)

Submission status: Runtime Error

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

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

n = int(input())
a =[chr(ord('a') + i) for i in range(26)]
a.insert(0,0)
u = []
while n!=0:
    k = n % 26
    u.append(k)
    n //= 26
ans = []
for i in range(len(u)):
    ans.append(a[u[i]])
ans.reverse()
print("".join(ans))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)

n = int(input())
#b = list(map(int, input().split()))
#n, m = map(int, input().split())
#s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

MAX_N = 1000000000000001

d = {(i-97+1):chr(i) for i in range(97,97+26)}

l = []

while n > 0:
    tmp = n%26
    l.append(tmp)
    n -= tmp
    n //= 26

ans = ''

for i in l[::-1]:
    ans += d[i]
    
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
intTOch = {i + 1: c for i, c in zip(range(26), [chr(i) for i in range(97, 97 + 26)])}
ans = ''
while n != 0:
    ans += intTOch[n % 26]
    n //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
n=int(input())
s=''
while n:
    n-=1
    s=chr(97+total%26)+s
    n//=26

print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
def convert(n,k):
    result = ""
    while n>0:
        result = al[(n%k)-1]+result
        n //= k
    return result
print(convert(N,26))

Submission status: Runtime Error

Solution code:
N = int(input())
l = []
alpha = "abcdefghijklmnopqrstuvwxyz"
d = {i+1: a for i, a in enumerate(alpha)}
while N != 0:
    l.append(N % 26)
    N = N // 26
ans = []
for i in l[::-1]:
    ans.append(d[i])
print("".join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
d = {y: x for x, y in zip("abcdefghijklmnopqrstuvwxyz", range(1, 27))}
array = []
while n > 0:
    array.append(n % 26)
    n //= 26
print("".join([d[x] for x in array[::-1]]))

Submission status: Runtime Error

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()
ans = ""
while True:
	if n <= 26:
		ans = chr(96+n) + ans
		break
	else:
		po = n % 26
		if po == 0:
			po = 26
		ans = chr(96+po) + ans
		n //= 26
print(ans)

import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()
ans = ""
while True:
	if n <= 26:
		ans = chr(96+n) + ans
		break
	else:
		po = n % 26
		if po == 0:
			po = 26
		ans = chr(96+po) + ans
		n //= 26
print(ans)