Harryxun/stf_run huggingface dataset:
n_,d,a=map(int,input().split())
xh=[list(map(int,input().split())) for _ in range(n_)]
"""
n_=2*1000
d=0 #pow(10,9)
a=1
xh=[[pow(10,9)//i,pow(10,9)] for i in range(1,1+n_)]
"""
xh.sort(key=lambda x:x[0])

#A1 ... AnのBIT(1-indexed)
n=xh[-1][0]
BIT = [0]*(n+1)

#A1 ~ Aiまでの和 O(logN)
def BIT_query(idx):
    res_sum = 0
    if idx==0:
      return 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

#Ai += x O(logN)
def BIT_update(idx,x):
  if idx==0:
    print('index 0!')
    return 
  while idx <= n:
      BIT[idx] += x
      idx += idx&(-idx)
  return

ans=0
for x,h in xh:
  fd=BIT_query(min(x+2*d,xh[-1][0]))-BIT_query(max(0,x-1))
  if h-fd<=0:
    pass
  else:
    c=(h-fd)//a
    BIT_update(min(x+2*d,xh[-1][0]),c*a)
    ans+=c
  pre_x=x
print(ans)

### FIXED CODE ###

n,d,a=map(int,input().split())
xh=[list(map(int,input().split())) for _ in range(n)]
xh.sort(key=lambda x:x[0])
from collections import deque
minusd=deque()
nowd=0
ans=0
for x,h in xh:
  while minusd and minusd[0][1]<=x:
    d_,_=minusd.popleft()
    nowd-=d_
  tmp=max(0,(h-nowd+a-1)//a)
  ans+=tmp
  nowd+=tmp*a
  minusd.append([tmp*a,x+2*d+1])
  #print(ans,nowd)
print(ans)
from collections import deque

H,W = map(int,input().split())
S = [list(input().split()) for _ in range(H)]
a = 0

for h in range(H):
  for w in range(W): #スタートが(h,w)
    if S[h][w] == '#':
      continue
    d = [[-1]*W for i in range(H)]
    d[h][w] = 0
    
    q = deque([[h,w]])
    
    while q:
      nh,nw = q.pop()
      
      if nw+1<W and S[nh][nw+1]=='.' and d[nh][nw+1]==-1:
        d[nh][nw+1] = d[nh][nw]+1
        q.append([nh,nw+1])
      if 0<=nw-1 and S[nh][nw-1]=='.' and d[nh][nw-1]==-1:
        d[nh][nw-1] = d[nh][nw]+1
        q.append([nh,nw-1])
      if nh+1<H and S[nh+1][nw]=='.' and d[nh+1][nw]==-1:
        d[nh+1][nw] = d[nh][nw]+1
        q.append([nh+1,nw])
      if 0<=nh-1 and S[nh-1][nw]=='.' and d[nh-1][nw]==-1:
        d[nh-1][nw] = d[nh][nw]+1
        q.append([nh-1,nw])
    a = max(a,max([max(i) for i in d]))
    
print(a)

### FIXED CODE ###

from collections import deque

H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]
directions = [[0,1],[1,0],[0,-1],[-1,0]]

def f(h,w): #スタートが(h,w)
  if S[h][w] == '#':
    return 0
  else:
    d = [[-1]*W for i in range(H)]
    d[h][w] = 0
    
    q = deque([[h,w]])
    
    while q:
      nh,nw = q.pop()
      
      for dh,dw in directions:
        if not (0<=nh+dh<H and 0<=nw+dw<W):
          continue
        if S[nh+dh][nw+dw] == '#':
          continue
        if d[nh+dh][nw+dw] != -1:
          continue
        d[nh+dh][nw+dw] = d[nh][nw]+1
        q.appendleft([nh+dh,nw+dw])
     
    return max([max(i) for i in d])

a = 0
for h in range(H):
  for w in range(W):
    a = max(a,f(h,w))
    
print(a)
while(1):
    N=int(raw_input())
    if N==0:
        break
    else:
        gems=[]
        okflag=0
        loc=[10,10]
        for i in range(N):
            [gemx,gemy]=[int(x) for x in raw_input().split()]
            gems.append([gemx,gemy])
        M=int(raw_input())
        for i in range(M):
            com=raw_input().split()
            com[1]=int(com[1])
            if com[0]=="N":
                for j in range(com[1]):
                    loc[1]=loc[1]+1
                    if loc in gems:
                        gems.remove(loc)
                #loc[1]=loc[1]+com[1]
            elif com[0]=="S":
                for j in range(com[1]):
                    loc[1]=loc[1]-1
                    if loc in gems:
                        gems.remove(loc)
                #loc[1]=loc[1]-com[1]
            elif com[0]=="E":
                for j in range(com[1]):
                    loc[0]=loc[0]+1
                    if loc in gems:
                        gems.remove(loc)

                #loc[0]=loc[0]+com[1]
            else:
                for j in range(com[1]):
                    loc[0]=loc[0]-1
                    if loc in gems:
                        gems.remove(loc)
                #loc[0]=loc[0]-com[1]
            if len(gems)==0:
                okflag=1
                break
        if okflag:
            print "Yes"
        else:
            print "No"

### FIXED CODE ###

while(1):
    N=int(raw_input())
    if N==0:
        break
    else:
        gems=[]
        okflag=0
        loc=[10,10]
        for i in range(N):
            [gemx,gemy]=[int(x) for x in raw_input().split()]
            gems.append([gemx,gemy])
        M=int(raw_input())
        for i in range(M):
            com=raw_input().split()
            com[1]=int(com[1])
            if com[0]=="N":
                for j in range(com[1]):
                    loc[1]=loc[1]+1
                    if loc in gems:
                        gems.remove(loc)
                #loc[1]=loc[1]+com[1]
            elif com[0]=="S":
                for j in range(com[1]):
                    loc[1]=loc[1]-1
                    if loc in gems:
                        gems.remove(loc)
                #loc[1]=loc[1]-com[1]
            elif com[0]=="E":
                for j in range(com[1]):
                    loc[0]=loc[0]+1
                    if loc in gems:
                        gems.remove(loc)
                #loc[0]=loc[0]+com[1]
            else:
                for j in range(com[1]):
                    loc[0]=loc[0]-1
                    if loc in gems:
                        gems.remove(loc)
                #loc[0]=loc[0]-com[1]
            if len(gems)==0:
                okflag=1
        if okflag:
            print "Yes"
        else:
            print "No"
import itertools
n,m,v,p = map(int, input().split())
a = list(map(int, input().split()))
ans = p
a.sort(reverse=True)
def binary_search(left, right):
    if right - left <= 1:
        return left
    middle = (left + right) // 2
    if check(middle):
        return binary_search(middle, right)
    else:
        return binary_search(left, middle)

def check(target):
    used_vote = (p + n - target - 1) * m
    sum_vote = 0
    for i in range(target-1, p-2, -1):
        sum_vote += (a[target] + m) - a[i]
    if sum_vote >= m * v - used_vote: 
        return True
    else:
        return False

print(binary_search(0,n+1) + 1)

### FIXED CODE ###

n,m,v,p = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
def binary_search(left, right):
    if right - left <= 1:
        return left
    middle = (left + right) // 2
    if check(middle):
        return binary_search(middle, right)
    else:
        return binary_search(left, middle)

def check(target):
    used_vote = (p + n - target - 1) * m
    sum_vote = 0
    for i in range(target-1, p-2, -1):
        if a[target] + m < a[i]:
            return False
        sum_vote += (a[target] + m) - a[i]
    if sum_vote >= (m * v - used_vote): 
        return True
    else:
        return False
print(binary_search(0,n) + 1)
n, k = map(int, raw_input().split())


### FIXED CODE ###

a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))
X,Y=map(int,input().split())

#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
mod = 10 ** 9 + 7

if (X+Y)%3 != 0:
      print(0)
      exit()
 
n,x,y=0,X,Y
while x != y*2:
      x-=1
      y-=2
      n+=1
m=((X+Y)//3)-n

if n<0 or m<0:
    print(0)
    exit()

ans = nCr(n+m,n,mod)
print(ans)


### FIXED CODE ###

r=int(input())
print(r**2)
import numpy as np
N = int(input())
Hs = np.array(list(map(int, input().split()))).reshape(-1, 1)
As = Hs.repeat(N, axis=1)
h = As.T.copy()
L = np.array([i for i in range(N)]).reshape(-1, 1)
idxs = L.repeat(N, axis=1)
tidxs = idxs.T.copy()
co = As + h - np.abs(idxs-tidxs)
ans = N**2-np.count_nonzero(co)
print(ans//2)

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
L = [A[i]+i for i in range(N)]
R = [i-A[i] for i in range(N)]
c = Counter(R)

ans = 0
for l in L:
    ans += c[l]

print(ans)
#A - Ice Tea Store
Q,H,S,D = map(int,input().split())
N = int(input())

#2Lあたり
Q1,H1,S1 = 8*Q,4*H,2*S
S = min(Q1,H1,S1)


if 2*S>D:
    cnt_A = N//2
    cnt_B = N%2
    pay = a*cnt_A + (cnt_B/B)*(b/(2/B))
else:
    pay = (N//A) * (a/(2/A))
print(int(pay))

### FIXED CODE ###

#A - Ice Tea Store
Q,H,S,D = map(int,input().split())
N = int(input())

Q1,H1 = 4*Q,2*H
S = min(Q1,H1,S)

if 2*S>D:
    cnt_2 = N//2
    cnt_1 = N%2
    pay = D*cnt_2 + S*cnt_1
else:
    pay = N * S
print(pay)
import math
import itertools
import numpy as np

t = int(input())
g_all = np.array([list(input()) for i in range(t)])
num = 0
for i in range(t):
    if i%2 == 0 and g_all[i]%2 == 1:
        num+=1
print(num)


### FIXED CODE ###

import math
import itertools
import numpy as np

t = int(input())
a=list(map(int, input().split()))
num = 0
for i in range(t):
    if i%2 == 0 and a[i]%2 == 1:
        num+=1
print(num)
import math
N = int(input())
A = [int(i) for i in input().split()]

def mygcd(A):
    if len(A) == 1:
        return A[0]
    else:
        return math.gcd(A[0],mygcd(A[1:]))
        
ans = []
for i in range(N):
    ans.append(mygcd(A[:i]+A[i+1:]))

print(max(ans))

### FIXED CODE ###

from fractions import gcd
#input
N = int(input())
A = [int(i) for i in input().split()]
#cluc left and right gcd 
left = [0]*N
right = [0]*N
count = 0
left[0] = A[0]
right[-1] = A[-1]
Ans = []

for i in A[1:]:
    left[count+1] = gcd(left[count],i)
    count += 1

for i in reversed(A[:-1]):
    right[count-1] = gcd(right[count],i)
    count -= 1
# make ans
Ans.append(right[1])
Ans.append(left[-2])
for i in range(N-2):
    Ans.append(gcd(left[i],right[i+2]))
print(max(Ans))
s,t = map(input().split())

print(t + s)

### FIXED CODE ###

s,t = map(str, input().split())

print(t + s)
a, b=[int(i) for i in input().split()]
#def lcm(x,y):
    #return (x*y) // math.gcd(x,y)

  
import math  
z= (a * b)/math.gcd(a, b)
print(int(z))

### FIXED CODE ###

A, B=[int(i) for i in input().split()]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
  
print(lcm(A,B))
n, k = map(int, input().split())
arr = list(map(int, input().split()))
dp = [float('inf')] * n
dp[0] = 0
for i in range(1, n):
    dp[i] = min(dp[j] + abs(arr[i] - arr[j]) for j in range(max(i-k, 0), i))
print(dp[n-1])

### FIXED CODE ###

n = int(input())
arr = [int(x) for x in input().split()]
dp = [float('inf') for x in arr]
dp[0] = 0
for i in range(n):
    for j in (i+1, i+2):
        if j < n:
            dp[j] = min(dp[j], dp[i] + abs(arr[i] - arr[j]))
print(dp[-1])
import math
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, math.gcd(A[i],A[i+1]))
print(ans)

### FIXED CODE ###

import fractions
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, fractions.gcd(A[i],A[i+1]))
print(ans)
n=int(input())
l=list(map(int,input().split()))
from collections import defaultdict
d=defaultdict(int)
l1=set(l)
l2=[]
for i in l:
  d[i]+=1
if len(d)==1:
  if l[0]==0:
    print("Yes")
  else:
    print("No")
elif len(d)==2:
  for i in l1:
    l2.append(i)
  bool1=True
  if d[l2[0]]==d[l2[1]]*2:
    a=l2[0]
    b=l2[0]
    c=l2[1]
  elif d[l2[0]]*2==d[l2[1]]:
    a=l2[0]
    b=l2[1]
    c=l2[1]
  else:
    boo11=False
  if bool1:
    la=[]
    lb=[]
    lc=[]
    while a!=0:
      la.append(a%2)
      a=a//2
    while b!=0:
      lb.append(b%2)
      b=b//2
    while c!=0:
      lc.append(c%2)
      c=c//2
    while len(lb)<len(la):
      lb.append(0)
    while len(lc)<len(la):
      lc.append(0)
    bool1=True
    for i in range(len(la)):
      if la[i]+lb[i]+lc[i]==1 or la[i]+lb[i]+lc[i]==3:
        bool1=False
    if bool1:
      print("Yes")
    else:
      print("No")
  else:
    print("No")  
elif len(d)==3:
  for i in l1:
    l2.append(i)
  l2=sorted(l2)
  if d[l2[0]]==d[l2[1]] and d[l2[1]]==d[l2[2]]:
    a=l2[2]
    b=l2[1]
    c=l2[0]
    la=[]
    lb=[]
    lc=[]
    while a!=0:
      la.append(a%2)
      a=a//2
    while b!=0:
      lb.append(b%2)
      b=b//2
    while c!=0:
      lc.append(c%2)
      c=c//2
    while len(lb)<len(la):
      lb.append(0)
    while len(lc)<len(la):
      lc.append(0)
    bool1=True
    for i in range(len(la)):
      if la[i]+lb[i]+lc[i]==1 or la[i]+lb[i]+lc[i]==3:
        bool1=False
    if bool1:
      print("Yes")
    else:
      print("No")           
  else:
    print("No")
else:
  print("No")


### FIXED CODE ###

n=int(input())
def xor(x,y):
  bitx=[]
  bity=[]
  num1,num2=x,y
  while num1!=0:
    bitx.append(num1%2)
    num1//=2
  while num2!=0:
    bity.append(num2%2)
    num2//=2
  m=max(len(bitx),len(bity))
  while len(bitx)<m+1:
    bitx.append(0)
  while len(bity)<m+1:
    bity.append(0)
  ans=0
  for i in range(m):
    if bitx[i]!=bity[i]:
      ans+=2**i
  return ans
from collections import defaultdict
import sys
d=defaultdict(int)
l=list(map(int,input().split()))
if n%3!=0:
  for i in range(n):
    if l[i]!=0:
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()
for i in l:
  d[i]+=1
if len(d)>3:
  print("No")
elif len(d)==3:
  b=True
  l1=[]
  for i in d:
    l1.append(i)
    if d[i]!=n/3:
      b=False
  if l1[0]!=xor(l1[1],l1[2]) or l1[1]!=xor(l1[0],l1[2]) or l1[2]!=xor(l1[0],l1[1]):
    b=False
  if b:
    print("Yes")
  else:
    print("No")
elif len(d)==2:
  if d[0]!=n/3:
    print("No")
  else:
    print("Yes")
else:
  if d[0]==n:
    print("Yes")
  else:
    print("No")
import sys
sys.setrecursionlimit=10**12

def modinv(a,m=10**9+7):
    if a==0: return 1
    b=m
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return lastx % m

def cur(p):
    for x in neighbor[p]:
        if x!=par[p]:
            par[x]=p
            descend[p]+=cur(x)
    return descend[p]

def cur2(p):
    for x in neighbor[p]:
        if x==par[p]: continue
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])%mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[[]  for _ in range(n+1)]
descend=[1]*(n+1)
par=[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)
cur(1)

ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])%mod
ans[1]=ans1
cur2(1)
for i in range(1,n+1):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    if neighbor[p]==[]: return
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        cur(x)
    descend[par[p]]+=descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1 for i in range(n+1)]
par=[0]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])
n, T = map(int, input().split())

keep_cost = 1001

for i in range(n):
    c,t = map(int, input().split())
    if T >= t:
        if c <= keep_cost:
            keep_cost = c


print(keep_cost if keep_cos != 1001 else "TLE")

### FIXED CODE ###

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

keep_cost = 1001
taken_t = 1001
for i in range(n):
    c,t = map(int, input().split())
    if T >= t:
        if c <= keep_cost:
            keep_cost = c
            taken_t = t

print(keep_cost if taken_t <= T else "TLE")
x,k,d= map(int,input().split())
s=[]
x=abs(x)
if x>d*k:
  print(x-d*k)
else:
  for i in range(k):
    s.append(abs(x-d*i))
    s.sort()
  print(s[0])

### FIXED CODE ###

s=list(input())
count=0

if 'R' in s:
  count+=1
for i in range(len(s)-1):
  if s[i]==s[i+1] and s[i]=='R':
    count+=1
print(count)
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))
A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*(i-1))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*(i-1)),start)
    print(start)

### FIXED CODE ###

# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()
N = int(input())
K = int(input())
A = list(map(int, input().split()))
print(sum(A.sort()[0:K]))

### FIXED CODE ###

N, K = map(int, input().split()) 
A = list(map(int, input().split()))
A.sort()
print(sum(A[0:K]))
for i in range(2,1201):
    for j in range(2,int(i**0.5)+1):
        if not i%j:break
    else:p+=[i]
dp=[[0]*1200 for _ in range(15)]
dp[0][0]=1
for x,y in enumerate(p):
    for i in range(min(x+1,14),0,-1):
        for j in range(p[x],1200):
            dp[i][j]+=dp[i-1][j-y]
while 1:
    n,k=map(int,input().split())
    if n==0:break
    print(dp[k][n])

### FIXED CODE ###

p=[]
for i in range(2,1121):
    for j in range(2,int(i**0.5)+1):
        if not i%j:break
    else:p+=[i]
dp=[[0]*1121 for _ in range(15)]
dp[0][0]=1
for x,y in enumerate(p):
    for i in range(min(x+1,14),0,-1):
        for j in range(y,1121):
            dp[i][j]+=dp[i-1][j-y]
while 1:
    n,k=map(int,input().split())
    if n==0:break
    print(dp[k][n])
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

min_list = [a,b,c,d,e]
amari_list = [(a%10),(b%10),(c%10),(d%10),(e%10)]
amari_list.sort()

minute = 0
for i in range(ren(amari_list)):
    if (amari_list[i]%10)==0:
        minute += amari_list[i]
    else:
        minute = 10-(amari_list[i]%10)+amari_list[i]

print(minute)


min_value = [i for i, x in enumerate(amari_list) if x == amari_min]


### FIXED CODE ###

import itertools
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

tlist = [A, B, C, D, E]
l = itertools.permutations(tlist, 5)

t = []
count = 0

for i in l:
  count = 0
  for j in range(5):
    if j != 4 :
      count += int(math.ceil(i[j] / 10) * 10)
    else:
      count += i[j]
  t.append(count)
  
print(min(t))
import sys

A,B,C,D,E,F = list(map(int, input().split()))
#x is a list which represents for the volumn of water
x = list()

#y is a list which represents for the volumn of sugar
y = list()

for i in range(F//C+1):
    for j in range(F-C*i//D+1):
        if i == j == 0:
            continue
        tmp_y = i * C + j * D

        if tmp_y <= F:
            y.append(tmp_y)

for i in range(F//(100 * A)+1):
    for j in range(F-(100*A*i)//(100*B)+1):
        if i == j == 0:
            continue

        tmp_x = i * A * 100 + j * B * 100

        if tmp_x <= F:
            x.append(tmp_x)
#print(x)
#print(y)
ans_sweetwater = 0
ans_sugar = 0
ans_density = 0
density = E/(100+E)
#print("density: ",density)
for n in y:
    for m in x:
        tmp_density = n/(m+n)
        if m + n <= F and x/100*E >= y and ans_density <= tmp_density:
            ans_sweetwater =  m + n
            ans_sugar = n
            ans_density = tmp_density
print(ans_sweetwater,ans_sugar)


### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
 
x = set()
y = set()
 
for i in range(F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        if i + j == 0:
            continue
        x.add(A * i * 100 + B * j * 100)
 
for i in range(F // C + 1):
    for j in range((F - C * i) // D + 1):
        y.add(C * i + D * j)
 
ret_w = 1
ret_s = -1
 
for w in x:
    for s in y:
        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w:
            ret_s = s
            ret_w = w + s
 
print(ret_w, ret_s)
def resolve():
	import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    a = list(input().split() for _ in range(m))
    flag = [0]*2*n
    if m == 0:
        print("{} {}".format(0, 0))
        exit()
    miss = 0
    correct = 0
    for i in range(m):
        if flag[int(a[i][0])] == 0:
            if a[i][1] == "WA":
                miss += 1
            elif a[i][1] == "AC":
                correct += 1
                flag[int(a[i][0])] = 1
    print("{} {}".format(correct, miss))
resolve()

### FIXED CODE ###

def resolve():
    import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    if m == 0:
        print("{} {}".format(0, 0))
        exit()

    a = list(input().split() for _ in range(m))
    flag = [[0] * n for i in range(2)]
    miss = 0
    correct = 0
    for i in range(m):
        if flag[0][int(a[i][0]) - 1] == 0:
            if a[i][1] == "WA":
                flag[1][int(a[i][0]) - 1] += 1
            elif a[i][1] == "AC":
                correct += 1
                miss += flag[1][int(a[i][0]) - 1]
                flag[0][int(a[i][0]) - 1] = 1
    print("{} {}".format(correct, miss))
resolve()
k = int(input())
X,Y = map(int,input().split())
x = abs(X)
y = abs(Y)

if k%2 == 0 and (x+y)%2 == 1:
  print(-1)
  exit()
  
import math
ans = []
m = math.ceil((x+y)/k)
if (x+y)/k == int((x+y)/k):
  for i in range(m):
    ans.append((min(x,k*i+k),max(0,k*i+k-x)))
    
elif m == 1:
  if (x+y)%2 == 1:
    ans.append(x,x-k)
    ans.append(x+(k+x-y)//2,(-k+x+y)//2)
    ans.append(x,y)
  else:
    ans.append(-k+(x+y)//2,(x+y)//2)
    ans.append(x,y)
    
elif (m*k-x-y)%2 == 0:
  x += (m*k-x-y)//2
  for i in range(m-1):
    ans.append((min(x,k*i+k),max(0,k*i+k-x)))
  ans.append((abs(X),y))
  
elif (m*k-x-y)%2 == 1:
  x += (m*k-x-y)//2
  m += 1
  for i in range(m-1):
    ans.append((min(x,k*i+k),max(0,k*i+k-x)))
  ans.append((abs(X),y))
  
print(len(ans))
for i,j in ans:
  if X < 0:
    i *= -1
  if Y < 0:
    j *= -1
  print(i,j)

### FIXED CODE ###

k = int(input())
X,Y = map(int,input().split())
x = max(abs(X),abs(Y))
y = min(abs(X),abs(Y))
c = (k-(x+y)%k)%k
if k%2 == 0 and (x+y)%2 == 1:
  print(-1)
  exit()
  
import math
ans = []
m = math.ceil((x+y)/k)
if (x+y)/k == int((x+y)/k):
  for i in range(m):
    ans.append((min(x,k*i+k),max(0,k*i+k-x)))
    
elif m == 1:
  if (x+y)%2 == 1:
    ans.append((x,x-k))
    ans.append((x+(k+x-y)//2,(-k+x+y)//2))
    ans.append((x,y))
  else:
    ans.append(((x+y)//2,-k+(x+y)//2))
    ans.append((x,y))
               
elif c%2 == 0 and x+y >= k:
  a = abs((k*m-x-y)//2)
  for i in range(m-1):
    l = k*i+k
    if a >= l:
      ans.append((0,-l))
    elif a < l <= x+a:
      ans.append((l-a,-a))
    elif x+a < l:
      ans.append((x,l-x-2*a))
  ans.append((x,y))
  
else:
  m += 1
  a = abs((k*m-x-y)//2)
  for i in range(m-1):
    l = k*i+k
    if a >= l:
      ans.append((0,-1))
    elif a < l <= x+a:
      ans.append((l-a,-a))
    elif x+a < l:
      ans.append((x,l-x-2*a))
  ans.append((x,y))
  
print(len(ans))
for i,j in ans:
  if abs(X) < abs(Y):
    i,j = j,i
  if X < 0:
    i *= -1
  if Y < 0:
    j *= -1
  print(i,j)
import math

a, b, x = map(int, input().split())

if x >= a**2*b/2:
    print(math.degrees(math.atan(2*(a**2*b-x)/a**3)))

else:
    print(math.degrees(math.atan(a**2*b/(2*x)))

### FIXED CODE ###

import math

a, b, x = map(int, input().split())

if x >= a**2*b/2:
    print(math.degrees(math.atan(2*(a**2*b-x)/a**3)))

else:
    print(math.degrees(math.atan(b**2*a/(2*x))))
N = int(input())
alp = ["b","c","d","e","f","g","h","i","j","a"]
a = "a"
A = "a"
for i in range(N):
    word = [a]
    a = a + "a"
for i in range(N):
    word = [A]
    A = A + alp.pop(0)
word.pop(0)
word.sort()
s = "\n".join(word)
print(s)

### FIXED CODE ###

K = int(input())
alist = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(alist[K-1])