Harryxun/stf_run huggingface dataset:
icase=0
if icase==0:
    n,m=map(int, input().split())
    a=[]
    b=[]
    for i in range(m):
        ai,bi=map(int, input().split())
        a.appned(ai)
        b.appned(bi)
elif icase==1:
    n=6
    m=5
#    a=[[1],[2],[3],[4],[5]]
#    b=[[2],[3],[4],[5],[6]]
    a=[1,2,3,4,5]
    b=[2,3,4,5,6]
elif icase==2:
    n=7
    m=7
    a=[1,2,3,4,4,5,6]
    b=[3,7,4,5,6,6,7]

    
vtx=[]
for i in range(n):
    vtx.append([i+1])
icnt=0

for j in range(m):    
    vtx1=vtx.copy()
    a1=a.copy()
    b1=b.copy()
    del a1[j]
    del b1[j]
    
    for i in range(m-1):
        for v1 in vtx1:
            if a1[i] in v1:
                for v2 in vtx1:
                    if v1!=v2:
                        if b1[i] in v2:
                            break
                if v1!=v2:
                    vtx1.remove(v1)
                    vtx1.remove(v2)
                    v3=v1+v2
                    vtx1.append(v3)
#        print(a[i],b[i],len(vtx1),vtx1)
    print(len(vtx1),vtx1)
    if len(vtx1)!=1:
        icnt=icnt+1
print(icnt)        
#for i in range(m):
#    for v1 in vtx1:
#        if a[i] in v1:
#            for v2 in vtx1:
#                if v1!=v2:
#                    if b[i] in v2:
#                        break
#            if v1!=v2:
#                vtx1.remove(v1)
#                vtx1.remove(v2)
#                v3=v1+v2
#                vtx1.append(v3)
#    print(a[i],b[i],len(vtx1),vtx1)


### FIXED CODE ###

icase=0
if icase==0:
    n,m=map(int, input().split())
    a=[]
    b=[]
    for i in range(m):
        ai,bi=map(int, input().split())
        a.append(ai)
        b.append(bi)
elif icase==1:
    n=6
    m=5
#    a=[[1],[2],[3],[4],[5]]
#    b=[[2],[3],[4],[5],[6]]
    a=[1,2,3,4,5]
    b=[2,3,4,5,6]
elif icase==2:
    n=7
    m=7
    a=[1,2,3,4,4,5,6]
    b=[3,7,4,5,6,6,7]

    
vtx=[]
for i in range(n):
    vtx.append([i+1])
icnt=0

for j in range(m):    
    vtx1=vtx.copy()
    a1=a.copy()
    b1=b.copy()
    del a1[j]
    del b1[j]
    
    for i in range(m-1):
        for v1 in vtx1:
            if a1[i] in v1:
                if not b1[i] in v1:
                    for v2 in vtx1:
                        if v1!=v2:
                            if b1[i] in v2:
                                break
                    vtx1.remove(v1)
                    vtx1.remove(v2)
                    v3=v1+v2
                    vtx1.append(v3)
#        print(a[i],b[i],len(vtx1),vtx1)
#    print(len(vtx1),vtx1)
    if len(vtx1)!=1:
        icnt=icnt+1
print(icnt)
from collections import deque

N = int(input())
c = list(str(input()))
dw = deque()
dr = deque()

for i, c in enumerate(c, 1):
    if c == 'W':
        dw.append(i)
    else:
        dr.appendleft(i)

ans = 0
while dw:
    w = dw.popleft()
    r = dr.popleft()
    print(w, r)
    if w < r:
        ans += 1

    else:
        break
print(ans)

### FIXED CODE ###

from collections import deque

N = int(input())
c = list(str(input()))
dw = deque()
dr = deque()

for i, c in enumerate(c, 1):
    if c == 'W':
        dw.append(i)
    else:
        dr.appendleft(i)

ans = 0
while dw and dr:
    w = dw.popleft()
    r = dr.popleft()
    if w < r:
        ans += 1

    else:
        break
print(ans)
n=int(input())
node=[-1 for i in range(n)]
g=[[] for i in range(n)]
def color(par,i,ini):
  if node[i]>-1:
    return
  else:
    if par==-1:
      node[i]=0
    else:
      node[i]=abs(node[par]-ini)
  for j in range(len(g[i])):
    color(i,g[i][j][0],g[i][j][1])
  return
for i in range(n-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  w%=2
  g[u].append([v,w])
  g[v].append([u,w])
color(-1,0,0)
for i in range(n):
  if node[i]==-1:
    node[i]=0
  print(node[i])

### FIXED CODE ###

n=int(input())
node=[-1 for i in range(n)]
g=[[] for i in range(n)]
for i in range(n-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  w%=2
  g[u].append([v,w])
  g[v].append([u,w])
queue=[0]
node[0]=0
while len(queue)>0:
  t=queue.pop()
  for v,w in g[t]:
    if node[v]>-1:
      continue
    node[v]=node[t]^w
    queue.append(v)
for i in range(n):
  print(node[i])
A,B,C,X,Y = map(int,input().split())
if A+B <　2*C:print(A*X+B*Y)
else:
    if X>Y:print(min(2*Y*C+(X-Y)*A, 2*X*C))
    else:print(min(2*X*C+(Y-X)*B, 2*Y*C))

### FIXED CODE ###

A,B,C,X,Y=map(int,input().split())
if A+B<2*C:print(A*X+B*Y)
else:
    if X>Y:print(min(2*Y*C+(X-Y)*A,2*X*C))
    else:print(min(2*X*C+(Y-X)*B,2*Y*C))
N = int(input())
p_list =  list(map(int, input().split()))

i = 0
count = 0
while i < N:
    if p_list[i] == i + 1:
        temp = p_list[i+1]
        p_list[i+1] = p_list[i]
        p_list[i] = temp
        count = count + 1
        i = i + 1
    i = i + 1

print(count)


### FIXED CODE ###

N = int(input())
p_list =  list(map(int, input().split()))

i = 0
count = 0

if p_list[-1] == N:
    temp = p_list[-1]
    p_list[-1] = p_list[-2]
    p_list[-2] = temp
    count = count + 1

while i < N:
    if p_list[i] == i + 1:
        temp = p_list[i+1]
        p_list[i+1] = p_list[i]
        p_list[i] = temp
        count = count + 1
        i = i + 1
    i = i + 1

print(count)
D=input(int())
T=input(int())
S=input(int())

if S*T >=D:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

D,T,S = input().split()

D = int(D)
T = int(T)
S = int(S)


if S*T >=D:
  print('Yes')
else:
  print('No')
# coding: utf-8
# Your code here!
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

N=int(input())
a=list(map(int,input().split()))
calc=(lcm(a))  # 実行結果: 12

ans=0
for item in a:
    ans+=(calc)/item
    ans%=(10**9+7)

print(int((ans)%(10**9+7)))
    

### FIXED CODE ###

# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
import sys
input = sys.stdin.readline

import functools

def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def multiple(a, b):
    return a*b // euclid(a, b)
def lcm(nums):
        return functools.reduce(multiple, nums)


N=int(input())
a=list(map(int,input().split()))
calc=(lcm(a))  # 実行結果: 12


ans=0
for index,item in enumerate(a):
    ans+=(calc)//item

print(int((ans)%(10**9+7)))
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n, m = mi()
a = [li() for i in range(n)]
a.sort(reverse=True)
rem = m
sm = 0
while a:
    rate, cnt = a.pop()
    take = min(rem, cnt)
    sm += take * rate
    rem -= take
print(sm)
=

### FIXED CODE ###

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

n, m = mi()
a = [li() for i in range(n)]
a.sort(reverse=True)
rem = m
sm = 0
while a:
    rate, cnt = a.pop()
    take = min(rem, cnt)
    sm += take * rate
    rem -= take
print(sm)
from functools import reduce
def gcd(a, b):
  if (b == 0):
    return a;

  return gcd(b, a % b)


def lcm(a, b):
  return a * b / gcd(a, b);
def main():
  
  n = int(input())
  li = []
  for i in range(n):
    li.append(int(input()))

  ans = int(reduce((lambda x, y: lcm(x, y)), li))

  print(ans)

if __name__ == "__main__":
  main()

### FIXED CODE ###

from functools import reduce

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

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

def lcm(a, b): 
    def gcd(a, b):  # a >= b
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    return a * b // gcd(a, b)

def main():
  n = int(input())
  li = []
  for i in range(n):
    inp = int(input())
    li.append(inp)

  ans = int(reduce((lambda x, y: lcm(x, y)), li))
  if ans > 1000000000000000000:
    ans = 1000000000000000000
  print(ans)

if __name__ == "__main__":
  main()
x = int(input())
import math
for A in range(-10**5,10**5):
    A5 = A ** 5
    B = round(math.pow(x - A5,1/5),0)
    if  A5 == x + int(B) ** 5:
        print(A,int(B))
        quit()


### FIXED CODE ###

x = int(input())
import math
f = 1
for A in range(-10**5,10**5):
    A5 = A ** 5
    if x - A5 > 0:
        f = -1
        B = round(math.pow(x - A5,1/5),0)
    else:
        B = round(math.pow(-(x - A5),1/5),0)
    if  A5 == x + int(B*f) ** 5:
        print(A,int(B)*f)
        quit()
x = input()
out = x**3
print(out)

### FIXED CODE ###

print((int(input()))**3)
def popcnt1(n):
    return bin(n).count("1")

def okikae(n):
    kaisu = 0
    if n == 0:
        return 0
    while 1:
        P = popcnt1(n)
        n %= P
        kaisu += 1
        if n == 0:
            return kaisu

OKI = [okikae(i) for i in range(20001)]
X = int(input())
Norig = input()
N = int(Norig,2)
Npop = Norig.count("1")
F = Npop + 1
H = Npop - 1
if H == 0:
    H = -1
FueAmari = N%(Npop + 1)
if Npop != 1:
    HeruAmari = N%(Npop - 1)
else:
    HeruAmari = -1
Fues = []
Herus = []
fue = 1
heru = 1
for i in range(2*(10**5+1)):#2^0の桁から
    fue %= F
    heru %= H
    Fues.append(fue)
    Herus.append(heru)
    fue *= 2
    heru *= 2
RNorig = reversed(Norig)
Results = []
Zougen = []#増えたらTrue
Kaisu = [0] * X
#上の桁から見ていく。ゼロなら減ってイチなら増える
for n,bit in enumerate(Norig):#2**(N-1-n)の桁
    if bit == "0":#増える
        Zougen.append(True)
        print(1+OKI[(FueAmari + Fues[X-1-n] )% F])
    else:
        if H == -1:
            print(0)
            continue
        Zougen.append(False)
        print(1+OKI[(HeruAmari - Herus[X-1-n]) % F])

### FIXED CODE ###

def popcnt1(n):
    return bin(n).count("1")

def okikae(n):
    kaisu = 0
    if n == 0:
        return 0
    while 1:
        P = popcnt1(n)
        n %= P
        kaisu += 1
        if n == 0:
            return kaisu

OKI = [okikae(i) for i in range(200001)]
X = int(input())
Norig = input()
N = int(Norig,2)
Npop = Norig.count("1")
F = Npop + 1
H = Npop - 1
if H == 0:
    H = -1
FueAmari = N%(Npop + 1)
if Npop != 1:
    HeruAmari = N%(Npop - 1)
else:
    HeruAmari = -1
Fues = []
Herus = []
fue = 1
heru = 1
for i in range(2*(10**5+1)):#2^0の桁から
    fue %= F
    heru %= H
    Fues.append(fue)
    Herus.append(heru)
    fue *= 2
    heru *= 2
RNorig = reversed(Norig)
Results = []
Zougen = []#増えたらTrue
Kaisu = [0] * X
#上の桁から見ていく。ゼロなら減ってイチなら増える
for n,bit in enumerate(Norig):#2**(N-1-n)の桁
    if bit == "0":#増える
        Zougen.append(True)
        print(1+OKI[(FueAmari + Fues[X-1-n] )% F])
    else:
        if H == -1:
            print(0)
            continue
        Zougen.append(False)
        print(1+OKI[(HeruAmari - Herus[X-1-n]) % H])
print(list(map(int,input().split()))[0]%list(map(int,input().split()))[1])

### FIXED CODE ###

m,k = map(int,input().split())
if m%k==0:
  print(0)
else:
  print(1)
n, m, *s_c = map(int, open(0).read().split())

for i in range(0, m + 1, 2):
    s_c[i] -= 1

flag = False
for i in range(0, m + 1, 2):
    if flag:
        break
    for j in range(0, m + 1, 2):
        #print(i, j)
        #print(s_c[i], s_c[j], s_c[i + 1], s_c[j + 1])
        if s_c[i] == s_c[j] and s_c[i + 1] != s_c[j + 1]:
            flag = True
            break

if flag:
    print(-1)
else:
    num = [0] * 3
    for i in range(0, m, 2):
        num[s_c[i]] = s_c[i + 1] 
    if num[0] == 0:
        print(-1)
    else:
        print(''.join([str(n) for n in num]))

### FIXED CODE ###

n, m = map(int, input().split())

s = [0] * m
c = [0] * m

for i in range(m):
    s[i], c[i] = map(int, input().split())
    s[i] -= 1
    
num = [10] * n

flag = False
for i in range(m):
    if num[s[i]] != 10 and num[s[i]] != c[i]:
        #print("dif")
        flag = True
    else:
        num[s[i]] = c[i]
        
if 1 < n and num[0] == 0:
    #print("head is 0")
    flag = True
elif 1 < n and num[0] == 10:
    num[0] = 1

for i in range(n):
    if num[i] == 10:
        num[i] = 0

if flag:
    print(-1)
else:
    print(''.join([str(n) for n in num]))
a,b = input().split()
if(a==H):
    if(b==H):
        print("H")
    elif(b==D):
        print("D")
elif(a==D):
    if(b==H):
        print("D")
    elif(b==D):
        print("H")


### FIXED CODE ###

a,b = input().split()
if(a=="H"):
    if(b=="H"):
        print("H")
    elif(b=="D"):
        print("D")
elif(a=="D"):
    if(b=="H"):
        print("D")
    elif(b=="D"):
        print("H")
import math 
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
ans = ["pairwise coprime", "setwise coprime ", "not coprime"]

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
if gcd_list(A) != 1:
  print(ans[2])
  quit()
  
def seachPrimeNum(N):
    max = int(N ** (1 / 2))
    D = [0] * N
    D[0] = 1
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        nn = seachList[0]
        D[nn - 1] = nn
        primeNum.append(nn)
        tmp = nn
        for i in seachList:
          if i != nn:
            if i % tmp == 0:
              D[i - 1] = nn
        seachList = [i for i in seachList if i % tmp != 0]
    for i in seachList:
      D[i - 1] = i
    primeNum.extend(seachList)
    
    return primeNum, D  
  
primeNum, D = seachPrimeNum(1000000)
used = [0] * len(primeNum)

for i in range(N):
  now = A[i]
  q = []
  #print(now, D[now - 1])
  if now == D[now - 1]:
    q.append(now)
  else:
    while now != D[now - 1]:
      now = int(now / D[now - 1])
      if now in primeNum:
        q.append(now)
        
  for i in q:
    if used[primeNum.index(i)] == 0:
      used[primeNum.index(i)] = 1
    else:
      print(ans[1])
      quit()  

print(ans[0])


### FIXED CODE ###

from math import gcd
n = int(input())
a = [int(i) for i in input().split()]

g = a[0]
for i in range(n):
    g = gcd(g,a[i])
if g != 1:
    print("not coprime")
    exit()

m = max(a)
fac = [1]*(m+1)
for i in range(2,m+1):
    if fac[i] != 1:
      continue
    for j in range(i,m+1,i):
      fac[j] = i
      
s = set()
for i in range(n):
    x = fac[a[i]]
    if x == 1: 
      continue
    if x in s:
      print("setwise coprime")
      exit()
    s.add(x)
print("pairwise coprime")
a,b,c = map(int,input().split("/"))
print("2018/"+int(b)+"/"+int(c))

### FIXED CODE ###

s = input()
s = s.replace("2017","2018")
print(s)
#未完成
import math
import numpy as np
A, B, C, D = map(int, input().split())
lcmofCD = int(C * D / math.gcd(C, D))
divofAbyC = A // C
divofAbyD = A // D
divofBbyC = B // C
divofBbyD = B // D
divofBbylcm = B // lcmofCD
divofAbylcm = A // lcmofCD
ansofA = A - (divofAbyC + divofAbyD - divofAbylcm)
ansofB = B-(divofBbyC + divofBbyD - divofBbylcm)
ans = ansofB-ansofA

print("{}".format(ans))


### FIXED CODE ###

# 未完成
import fractions
import numpy as np
A, B, C, D = map(int, input().split())  # aaaaa
lcmofCD = int(C * D / fractions.gcd(C, D))
divofAbyC = (A-1) // C
divofAbyD = (A-1) // D
divofBbyC = B // C
divofBbyD = B // D  # aaaaa
divofBbylcm = B // lcmofCD
divofAbylcm = (A-1) // lcmofCD
ansofA = (A-1) - (divofAbyC + divofAbyD - divofAbylcm)
ansofB = B-(divofBbyC + divofBbyD - divofBbylcm)
ans = ansofB-ansofA

print("{}".format(ans))
import math
import sys
N = input()
lista = N.split()

A = lista[0]
B = lista[1]

C = float(A)
D = float(B)
print(int(C//D))



### FIXED CODE ###

from decimal import Decimal

C, D = map(Decimal, input().split())
print(int(C*D))
from bisect import insort_left
N, M = [int(a) for a in input().split(" ")]
ctab = {"1":2,"2":5,"3":5,"4":4,"5":5,"6":6,"7":3,"8":7,"9":6}
A = [(a, ctab[a]) for a in input().split(" ")]
prev = [None]*(N+1)
curr = [None]*(N+1)
for char, cost in A:
    if not prev[cost] or char>prev[cost]:
        prev[cost] = char

def insert(s, char):
    ls = list(s)[::-1]
    insort_left(ls, char)
    return int("".join(ls[::-1]))

tmp = ""
while any(prev):
    for i in range(1, N+1):
        maxval = -1
        for char, cost in A:
            if i-cost>=0 and prev[i-cost]:
                val = insert(prev[i-cost], char)
                maxval = val if val > maxval else maxval
        curr[i] = str(maxval) if maxval > 0 else None
    if curr[N] is not None:
        tmp = curr[N]
    curr, prev = prev, curr
print(tmp)

### FIXED CODE ###

N, M = [int(a) for a in input().split(" ")]
ctab = {"1":2,"2":5,"3":5,"4":4,"5":5,"6":6,"7":3,"8":7,"9":6}
A = sorted([(a, ctab[a]) for a in input().split(" ")], key=lambda t:t[0])
prev, curr = ([""]*(N+1), [""]*(N+1))

def maxs(s1, s2):
    return max(s1, s2, key=lambda s:len(s)) if len(s1)!=len(s2) else max(s1,s2)

char, cost = A[0]
for i in range(1, N+1):
    d, r = divmod(i, cost)
    prev[i] = char*d if r==0 else None
for char, cost in A[1:]:
    for i in range(1, N+1):
        if i-cost >= 0 and curr[i-cost] is not None:
            tmp = char+curr[i-cost]
            curr[i] = maxs(tmp, prev[i]) if prev[i] else tmp
        else:
            curr[i] = prev[i]
    curr, prev = prev, curr
print(prev[-1])
S = int(input())
h = S//3600
m = S%3600//60
s = S%60
print(h:m:s.split(":"))



### FIXED CODE ###

S = int(input())
h = S//3600
m = S%3600//60
s = S%60
print(f"{h}:{m}:{s}")
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math

setrecursionlimit(10**7)
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')
MOD = 10**9 + 7

def main():
	n = int(rl())

	@lru_cache(None)
	def dp(i, has0, has9):
		if i == n: return 1 if (has0 and has9) else 0
		cnt = 0
		for d in range(10):
			cnt += dp(i+1, has0 or d == 0, has9 or d == 9)
			cnt %= MOD 
		return cnt 

	print(dp(0, 0, 0))

	stdout.close()

if __name__ == "__main__":
	main()

### FIXED CODE ###

from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math

# setrecursionlimit(10**7)
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')
MOD = 10**9 + 7

def main():
	n = int(rl())

	dp = [[[0 for k in range(2)] for j in range(2)] for i in range(n+1)]
	dp[0][0][0] = 1

	for i in range(n):
		for j in range(2):
			for k in range(2):
				for d in range(10):
					nj = j or d == 0
					nk = k or d == 9
					dp[i+1][nj][nk] += dp[i][j][k]
					dp[i+1][nj][nk] %= MOD 

	ans = dp[n][1][1]
	print(ans)
	stdout.close()

if __name__ == "__main__":
	main()
N, M = map(int, input().split())
s = [list(map(int, input().spllit())) [1:] for i in range(M)]
p = list(map(int, input().split()))
total = 0
j = 0
for i in range(2 ** N):
  now = format(i, '10b')
  for k in range(M):
    tmp = 0
    for l in s[k]:
      tmp += int(now[-l])
    if tmp % 2 == p[k]:
      j += 1
  if j == M :
    total += 1
  j = 0
print(total)


### FIXED CODE ###

n, m = map(int, input().split())
switch = []
for i in range(m):
    switch.append(list(map(int, input().split())))
p = list(map(int, input().split()))

ans = 0
for i in range(2**n):
    i = format(i, "0{}b".format(n))
    flag = 1
    for j in range(m):
        count = 0
        for k in range(switch[j][0]):
            if i[switch[j][k+1]-1] == "1":
                count += 1
        if count % 2 == p[j]:
            continue
        else:
            flag = 0
            break
    if flag == 1:
        ans += 1
print(ans)
N,M=map(int,input().split())
li=[0]*n
for i in range(M):
    si,ci=map(int,input().split())
    if li[si-1] != 0 and li[si-1] !=ci:
        print(-1)
        exit(0)
    if si==1 and ci==0:
        if N>1:
            print(-1)
            exit(0)
    li[si-1]=ci
if N>1 and li[0]==0:
    li[0]=1
for i in range(N):
    print(li[i],end="")


### FIXED CODE ###

N,M=map(int,input().split())
li=[0]*N
for i in range(M):
    si,ci=map(int,input().split())
    if li[si-1] != 0 and li[si-1] !=ci:
        print(-1)
        exit(0)
    if si==1 and ci==0:
        if N>1:
            print(-1)
            exit(0)
    li[si-1]=ci
if N>1 and li[0]==0:
    li[0]=1
for i in range(N):
    print(li[i],end="")
import math
A, B = map(int, input().split())

def lcm(x, y):
    return x // math.gcd(x, y)* y

print(lcm(A, B))

### FIXED CODE ###

from fractions import gcd

A, B = map(int, input().split())

print(A * B // gcd(A, B))
x = input()

if x >= 30:
  print("Yes")
 
else:
  print("No")

### FIXED CODE ###

x = int(input())

if x >= 30:
  print('Yes')
else:
  print('No')
"""
手順
1. 必要になる桁数を求め，アルファベットの順番を保存するリスト「ans」を作成する
2. 
"""


N = int(input())  # 変換したい10進数の値
K = 26  # 進数

al = [chr(i) for i in range(97, 97+K)]


def change(N):
    # 手順１の実装（元のプログラムから手を入れてます）
    keta = 0
    # 桁が切り替わる時は26のi乗の時ではなく26のi乗にそれまでの数値を足したものである
    # tmpはi-1乗までの数値を記録する変数として使用
    tmp = 0
    for i in range(10**9):
        if N < K**i + tmp:
            keta = i
            break
        tmp += K**i
    ans = [0] * keta  # 桁数の配列を準備する
    # print(ans)  # デバッグ用

    # 手順2の実装
    check = 0
    for i in range(1, keta+1):
        j = N // (K ** (keta - i))
        if j * (K ** (keta - i)) == N and i != keta:
            j -= 1
        N -= j * (K**(keta-i))
        ans[check] = j
        check += 1
    return ans


for i in change(N):
    print(al[i-1], end='')


### FIXED CODE ###



def main():
    N = int(input())
    digits = []

    while N != 0:
        digits.append(N % 26)
        if digits[-1] == 0:
            digits[-1] = 26
            N //= 26
            N -= 1
        else:
            N //= 26
    digits.reverse()
    for d in digits:
        print(chr(96 + d), end='')
    print()  # 改行


if __name__ == '__main__':
    main()