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:
import math
N=int(input())
a=int(math.log(N,26))

def saiki(nokori):
    if(nokori<26):

        return aru_list[nokori]
    else:
        return saiki(nokori//26)+aru_list[nokori%26]

koremade=0
nokori=N
count=0

while(1):
    if(nokori-26**(count+1)==0):

        break
    elif(nokori-26**(count+1)<0):
        break
    else:
        nokori=nokori-26**(count+1)

    count=count+1
count=count+1


nokori=nokori-1

aru_list=['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=''
ans=saiki(nokori)


while(1):
    if(len(ans)==count):
        print(ans)
        exit()
    else:
        ans='a'+ans

Submission status: Accepted

Solution code:
n = int(input())
numbers = []
strings = []
order = 0
while True:
  if n //  26**order > 0:
    order = order + 1
  else:
    break
for i in range(order,0,-1):
  number = n //(26**(i-1))
  n = n - number*26**(i-1)
  numbers.append(number)
  
for i in range(order,1,-1):
  if numbers[i-1] <= 0:
    numbers[i-1] = numbers[i-1] + 26
    numbers[i-2] = numbers[i-2] - 1
 
for i in range(0,order):
  if numbers[i] == 0:
    pass
  else:
    strings.append(chr(ord("a")+int(numbers[i]-1)))
 
print(''.join(strings))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(name[::-1])

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())


ord_a = ord("a")
def C(i):
    return chr(ord_a + i)

def conv(x):
    ans = []
    while x > 0:
        x -= 1
        y = (x)%26
        c = C(y)
        ans.append(c)
        x = x//26
    return "".join(reversed(ans))

print(conv(n))

Submission status: Accepted

Solution code:
N = int(raw_input())
N -= 1
alphabet = 'abcdefghijklmnopqrstuvwxyz'

p = 26
while N >= p:
  N -= p
  p *= 26
  
p /= 26
answer = ''
while p >= 1:
  answer += alphabet[N/p]
  
  N %= p
  p /= 26
  

print answer

Submission status: Accepted

Solution code:
x = int(input())
x -= 1
temp = 1
#ans = ''
# a = chr(97)
# z = chr(97 + 26)
while True:
    mod = x % 26
    div = x // 26

    add = chr(97 + mod)

    if (temp == 1):
        ans = add
    else:
        ans = add + ans

    if (div == 0):
        print(ans)
        exit()

    x /= 26
    x = int(x-1)
    temp += 1
    #print(ans, x)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    nl = 0
    yokei = 0
    yokei_pre = 0
    while yokei < n:
        nl += 1
        yokei_pre = yokei
        yokei += 26 ** nl

    n -= yokei_pre
    n -= 1
    c = [0] * nl
    for i1 in range(1, nl + 1):
        r = n % 26
        c[-i1] = r
        n = n // 26
    cs = []
    for ce in c:
        ce += 97
        cec = chr(ce)
        cs.append(cec)
    print("".join(cs))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())
mod = 10**9 + 7
dog = 10 ** 15 + 1

def main():
  n = int(input())
  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:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

def main(N):
  A = [1]
  for _ in range(100):
    A.append(A[-1] * 26)
  for n in range(1, 100):
    if N > A[n]:
      N -= A[n]
      continue

    N -= 1
    ret = []
    
    for _ in range(n):
      N, r = divmod(N, 26)
      ret.append(r)
    break
  ret = [chr(ord('a') + x) for x in ret]
  return ''.join(reversed(ret))
 
print(main(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:
	n-=1
	ans+=chr(n%26+ord("a"))
	n//=26
print(ans[::-1])

Submission status: Accepted

Solution code:
import string

N = int(input())
ans = []
S =""

while N != 0:
    N -= 1
    a = N % 26
    b = N // 26
    N = b
    ans.append(a)
ans = reversed(ans)

for s in ans:
    S += string.ascii_lowercase[int(s)]

print(S)

Submission status: Accepted

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


def solve(N: int):
    x = 1
    y = ""
    z = N
    while(z > 26):
        z -= 26 ** x
        if z > 0 :
            x += 1
    for i in range(x):
        N -= 1
        y += chr(ord('a') + N % 26)
        N //= 26
    print(y[::-1])
    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
keta = 1
su = 0
while True:
    su += 26**keta
    if su >= n:
        break
    keta += 1
n -= su - pow(26,keta) + 1
# print(n)
res = []
for i in range(keta):
    now = keta-i-1
    d,m = divmod(n,pow(26,now))
    res.append(chr(ord('a') + d))
    n = m
print(''.join(res))

Submission status: Accepted

Solution code:
N = int(input())
for d in range(64):
  if N < (26**(d+1)-1)//(26-1):
    N = N-(26**d-1)//(26-1)
    break
#print(d, N)
L = []
for i in range(d):
  n = N%26
  c = "abcdefghijklmnopqrstuvwxyz"[n]
  L.append(c)
  N = N//26
r = "".join(reversed(L))
print(r)

Submission status: Accepted

Solution code:
a=int(input())
K = 0
b = 0
List = [27]*13
res = ""
for i in range(12):
  K = a % 26
  if K ==0:
    K=26
  List[i] = int(K)
  b = a-K
  if b >=26:
    a = b/26
  else:
    break
for i in range(13):
  if List[12-i] ==27:
    pass
  else:
    res += chr(List[12-i]+96)
print(res)

Submission status: Accepted

Solution code:
N=int(input())


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

Submission status: Accepted

Solution code:
N = int(input())

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


print(string[::-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:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N = int(readline())
    
    ans = ''
    while N:
        N -= 1
        ans += chr((N % 26) + 97)
        N //= 26

    print(ans[::-1])

if __name__ == "__main__":
    main()

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 = N // 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())

moji = [chr(i) for i in range(97, 97+26)]
ans = ''
while n > 0:
    n -= 1
    x = int(n % 26)
    ans = moji[n % 26] + ans
    n //= 26
print(ans)

Submission status: Accepted

Solution code:
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction

mod = 10 ** 9 + 7
mod1 = 998244353

# ------------------------------warmup----------------------------
import os
import sys
from io import BytesIO, IOBase

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


# -------------------game starts now----------------------------------------------------import math
class TreeNode:
    def __init__(self, k, v):
        self.key = k
        self.value = v
        self.left = None
        self.right = None
        self.parent = None
        self.height = 1
        self.num_left = 1
        self.num_total = 1


class AvlTree:

    def __init__(self):
        self._tree = None

    def add(self, k, v):
        if not self._tree:
            self._tree = TreeNode(k, v)
            return
        node = self._add(k, v)
        if node:
            self._rebalance(node)

    def _add(self, k, v):
        node = self._tree
        while node:
            if k < node.key:
                if node.left:
                    node = node.left
                else:
                    node.left = TreeNode(k, v)
                    node.left.parent = node
                    return node.left
            elif node.key < k:
                if node.right:
                    node = node.right
                else:
                    node.right = TreeNode(k, v)
                    node.right.parent = node
                    return node.right
            else:
                node.value = v
                return

    @staticmethod
    def get_height(x):
        return x.height if x else 0

    @staticmethod
    def get_num_total(x):
        return x.num_total if x else 0

    def _rebalance(self, node):

        n = node
        while n:
            lh = self.get_height(n.left)
            rh = self.get_height(n.right)
            n.height = max(lh, rh) + 1
            balance_factor = lh - rh
            n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
            n.num_left = 1 + self.get_num_total(n.left)

            if balance_factor > 1:
                if self.get_height(n.left.left) < self.get_height(n.left.right):
                    self._rotate_left(n.left)
                self._rotate_right(n)
            elif balance_factor < -1:
                if self.get_height(n.right.right) < self.get_height(n.right.left):
                    self._rotate_right(n.right)
                self._rotate_left(n)
            else:
                n = n.parent

    def _remove_one(self, node):
        """
        Side effect!!! Changes node. Node should have exactly one child
        """
        replacement = node.left or node.right
        if node.parent:
            if AvlTree._is_left(node):
                node.parent.left = replacement
            else:
                node.parent.right = replacement
            replacement.parent = node.parent
            node.parent = None
        else:
            self._tree = replacement
            replacement.parent = None
        node.left = None
        node.right = None
        node.parent = None
        self._rebalance(replacement)

    def _remove_leaf(self, node):
        if node.parent:
            if AvlTree._is_left(node):
                node.parent.left = None
            else:
                node.parent.right = None
            self._rebalance(node.parent)
        else:
            self._tree = None
        node.parent = None
        node.left = None
        node.right = None

    def remove(self, k):
        node = self._get_node(k)
        if not node:
            return
        if AvlTree._is_leaf(node):
            self._remove_leaf(node)
            return
        if node.left and node.right:
            nxt = AvlTree._get_next(node)
            node.key = nxt.key
            node.value = nxt.value
            if self._is_leaf(nxt):
                self._remove_leaf(nxt)
            else:
                self._remove_one(nxt)
            self._rebalance(node)
        else:
            self._remove_one(node)

    def get(self, k):
        node = self._get_node(k)
        return node.value if node else -1

    def _get_node(self, k):
        if not self._tree:
            return None
        node = self._tree
        while node:
            if k < node.key:
                node = node.left
            elif node.key < k:
                node = node.right
            else:
                return node
        return None

    def get_at(self, pos):
        x = pos + 1
        node = self._tree
        while node:
            if x < node.num_left:
                node = node.left
            elif node.num_left < x:
                x -= node.num_left
                node = node.right
            else:
                return (node.key, node.value)
        raise IndexError("Out of ranges")

    @staticmethod
    def _is_left(node):
        return node.parent.left and node.parent.left == node

    @staticmethod
    def _is_leaf(node):
        return node.left is None and node.right is None

    def _rotate_right(self, node):
        if not node.parent:
            self._tree = node.left
            node.left.parent = None
        elif AvlTree._is_left(node):
            node.parent.left = node.left
            node.left.parent = node.parent
        else:
            node.parent.right = node.left
            node.left.parent = node.parent
        bk = node.left.right
        node.left.right = node
        node.parent = node.left
        node.left = bk
        if bk:
            bk.parent = node
        node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
        node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
        node.num_left = 1 + self.get_num_total(node.left)

    def _rotate_left(self, node):
        if not node.parent:
            self._tree = node.right
            node.right.parent = None
        elif AvlTree._is_left(node):
            node.parent.left = node.right
            node.right.parent = node.parent
        else:
            node.parent.right = node.right
            node.right.parent = node.parent
        bk = node.right.left
        node.right.left = node
        node.parent = node.right
        node.right = bk
        if bk:
            bk.parent = node
        node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
        node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
        node.num_left = 1 + self.get_num_total(node.left)

    @staticmethod
    def _get_next(node):
        if not node.right:
            return node.parent
        n = node.right
        while n.left:
            n = n.left
        return n
avl=AvlTree()
#-----------------------------------------------binary seacrh tree---------------------------------------
class SegmentTree1:
    def __init__(self, data, default='z', func=lambda a, b: min(a ,b)):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()

        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])

    def __delitem__(self, idx):
        self[idx] = self._default

    def __getitem__(self, idx):
        return self.data[idx + self._size]

    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1

    def __len__(self):
        return self._len

    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size

        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res

    def __repr__(self):
        return "SegmentTree({0})".format(self.data)


# -------------------game starts now----------------------------------------------------import math
class SegmentTree:
    def __init__(self, data, default=0, func=lambda a, b: a * a + b * b):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()

        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])

    def __delitem__(self, idx):
        self[idx] = self._default

    def __getitem__(self, idx):
        return self.data[idx + self._size]

    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1

    def __len__(self):
        return self._len

    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size

        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res

    def __repr__(self):
        return "SegmentTree({0})".format(self.data)


# -------------------------------iye ha chutiya zindegi-------------------------------------
class Factorial:
    def __init__(self, MOD):
        self.MOD = MOD
        self.factorials = [1, 1]
        self.invModulos = [0, 1]
        self.invFactorial_ = [1, 1]

    def calc(self, n):
        if n <= -1:
            print("Invalid argument to calculate n!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.factorials):
            return self.factorials[n]
        nextArr = [0] * (n + 1 - len(self.factorials))
        initialI = len(self.factorials)
        prev = self.factorials[-1]
        m = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = prev * i % m
        self.factorials += nextArr
        return self.factorials[n]

    def inv(self, n):
        if n <= -1:
            print("Invalid argument to calculate n^(-1)")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        p = self.MOD
        pi = n % p
        if pi < len(self.invModulos):
            return self.invModulos[pi]
        nextArr = [0] * (n + 1 - len(self.invModulos))
        initialI = len(self.invModulos)
        for i in range(initialI, min(p, n + 1)):
            next = -self.invModulos[p % i] * (p // i) % p
            self.invModulos.append(next)
        return self.invModulos[pi]

    def invFactorial(self, n):
        if n <= -1:
            print("Invalid argument to calculate (n^(-1))!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.invFactorial_):
            return self.invFactorial_[n]
        self.inv(n)  # To make sure already calculated n^-1
        nextArr = [0] * (n + 1 - len(self.invFactorial_))
        initialI = len(self.invFactorial_)
        prev = self.invFactorial_[-1]
        p = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = (prev * self.invModulos[i % p]) % p
        self.invFactorial_ += nextArr
        return self.invFactorial_[n]


class Combination:
    def __init__(self, MOD):
        self.MOD = MOD
        self.factorial = Factorial(MOD)

    def ncr(self, n, k):
        if k < 0 or n < k:
            return 0
        k = min(k, n - k)
        f = self.factorial
        return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD


# --------------------------------------iye ha combinations ka zindegi---------------------------------
def powm(a, n, m):
    if a == 1 or n == 0:
        return 1
    if n % 2 == 0:
        s = powm(a, n // 2, m)
        return s * s % m
    else:
        return a * powm(a, n - 1, m) % m


# --------------------------------------iye ha power ka zindegi---------------------------------
def sort_list(list1, list2):
    zipped_pairs = zip(list2, list1)

    z = [x for _, x in sorted(zipped_pairs)]

    return z


# --------------------------------------------------product----------------------------------------
def product(l):
    por = 1
    for i in range(len(l)):
        por *= l[i]
    return por


# --------------------------------------------------binary----------------------------------------
def binarySearchCount(arr, n, key):
    left = 0
    right = n - 1

    count = 0

    while (left <= right):
        mid = int((right + left)/ 2)

        # Check if middle element is
        # less than or equal to key
        if (arr[mid]<=key):
            count = mid+1
            left = mid + 1

        # If key is smaller, ignore right half
        else:
            right = mid - 1

    return count


# --------------------------------------------------binary----------------------------------------
def countdig(n):
    c = 0
    while (n > 0):
        n //= 10
        c += 1
    return c


def countGreater( arr,n, k):
    l = 0
    r = n - 1

    # Stores the index of the left most element
    # from the array which is greater than k
    leftGreater = n

    # Finds number of elements greater than k
    while (l <= r):
        m = int(l + (r - l) / 2)
        if (arr[m] >= k):
            leftGreater = m
            r = m - 1

        # If mid element is less than
        # or equal to k update l
        else:
            l = m + 1

    # Return the count of elements
    # greater than k
    return (n - leftGreater)


# --------------------------------------------------binary------------------------------------
n=int(input())
w=[chr(i) for i in range(97,123)]
w=w
ans=[]
while(n>0):
  t=n%26
  ans.append(w[n%26-1])
  n//=26
  if t==0:
      n-=1
ans=ans[::-1]
print(*ans,sep="")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    
    n = int(input())
    index = "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".split()

    s = ""
    m = n
    while True:
        o = m%26
        if m > 0 and o == 0:
            m -= 26
            o = 26
        s = index[o-1] + s
        m = m // 26
        if m == 0: break

    print(s)

Submission status: Accepted

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

print(ans[::-1])

Submission status: Accepted

Solution code:
n = int(input())
l = list()
name_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'}
name = ''

while n != 0:
	n -= 1
	l.append(n%26)
	n = n//26

if l != []:
	for i in reversed(l):
		name += name_dict[i]

print(name)

Submission status: Accepted

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

Submission status: Accepted

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

def find_name(tmp_N, p, keta, alpha):
  if keta == 1:
    for i in range(len(alpha)):
      #print(tmp_N + (i+1))
      if tmp_N + (i+1) == N:
        p.append(i)
        return p
  else:
    for i in range(len(alpha)):
      if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):
        p.append(i)
        tmp_N = tmp_N + 26**(keta-1)*i
        keta -= 1
        return find_name(tmp_N, p, keta, alpha)
    
# 桁数の確認
keta = 1
tmp_N = 0
while 1:
  if tmp_N + 1 <= N <= tmp_N + 26**keta:
    break
  else:
    keta += 1
    tmp_N += 26**(keta-1)
#print(keta)

p = []
p = find_name(tmp_N, p, keta, alpha)
out = ''
#print(p)
for i in range(len(p)):
  out += alpha[p[i]]
print(out)

Submission status: Accepted

Solution code:
def find_j(h):
    p = []
    psum = 0
    for i in range(13):
        pi = 26**i
        psum += pi
        p.append(psum)
    
    n_p = len(p)
    for i in range(n_p):
        if p[i] > h:
            return i
    return 1

def find_k(h, j):
    n_block = 26**j
    
    for i in range(1,27):
        div_fin = n_block // 26 * i
        if h <= div_fin:
            return i

def main():
    n = int(input())
    
    alp_ = "abcdefghijklmnopqrstuvwxyz"
    alp = [alp_[i] for i in range(26)]
    
    h = n
    j = find_j(h)
    h = h - (26**j - 1)//25 + 1
    k = j
    ans = ""
    #print(h,k)
    
    for _ in range(j):
        k = find_k(h, j)
        ans = ans + alp[k-1]
        h = h - 26**(j-1) * (k - 1)
        j -= 1
        #print(h,k)
    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def f(x):
    alp='abcdefghijklmnopqrstuvwxyz'
    keta=1
    saidai=26
    while saidai<x:
        keta+=1
        saidai+=26**keta
        
    out=[0]*keta
    for i in range(keta):
        x-=26**i
        
    for i in range(keta):
        tmp=x//26**(keta-i-1)
        out[i]+=tmp
        x-=tmp*26**(keta-i-1)
        
    out=[alp[out[i]] for i in range(keta)]
    return out

N=int(input())
print(''.join(f(N)))

Submission status: Accepted

Solution code:
n = int(input())
ans = str()
check = ["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 n != 0:
    n -= 1
    ans += check[n%26]
    n //= 26

print(ans[::-1])

Submission status: Accepted

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

Submission status: Accepted

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

    i = 1
    sub = 0
    while True:
        if N <= 26 ** i:
            N -= 1

            for j in range(i):
                ans += chr(ord('a') + N % 26)
                N //= 26
            
            break

        else:
            N -= 26 ** i
            
        i += 1
    
    print(ans[::-1])
        
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())

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

ans = ""
N -= 1
for i in range(s):
    ans += chr(ord("a") + N % 26)
    N = N // 26

print(ans[::-1])

Submission status: Accepted

Solution code:
N = int(input())

a = {
    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'
    }
m = []
q = N - 1
while True:
    q, mod = divmod(q, 26)
    m.append(a[mod])
    if q == 0:
        print(''.join(reversed(m)))
        exit()
    q -= 1