Harryxun/stf_run huggingface dataset:
n,m=map(int,input().split())
a=[]
b=[]
for i in range(n):
  x,y=map(int,input().split())
  a.append(x,y)
for i in range(m):
  x,y=map(int,input().split())
  b.append(x,y)
for i in a:
  ans=10**18
  t=0
  for j in b:
    if abs(i[0]-j[0])+abs(i[1]-j[1])<ans:
      t=j+1
      ans=abs(i[0]-j[0])+abs(i[1]-j[1])
  print(t)

### FIXED CODE ###

n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(n):
  A,B=map(int,input().split())
  a.append(A)
  b.append(B)
for i in range(m):
  C,D=map(int,input().split())
  c.append(C)
  d.append(D)
for i in range(n):
  minimum=1000000000
  ans=0
  for j in range(m):
    if abs(a[i]-c[j])+abs(b[i]-d[j])<minimum:
      minimum=abs(a[i]-c[j])+abs(b[i]-d[j])
      ans=j+1
  print(ans)
import collections
n=int(input())
V=list(map(int, input().split()))

Vo=V[::2]
Ve=V[1::2]

oddmost = collections.Counter(Vo).most_common()[0][1]
oddsec = collections.Counter(Vo).most_common()[1][1]
evenmost = collections.Counter(Ve).most_common()[0][1]
evensec = collections.Counter(Ve).most_common()[1][1]

if oddmost!=evenmost:
    print(len(V)-oddmost-evenmost)
else:
    print(min(len(V)-oddmost-evensec, len(V)-evenmost-oddsec))

### FIXED CODE ###

import collections

n=int(input())
vs=list(map(int,input().split()))

vs_odd=vs[::2]
c_odd=collections.Counter(vs_odd) 
C1=c_odd.most_common()
C1.append((0,0))
common1=C1[0][1] #最頻値の個数
common1sec=C1[1][1] #第2頻値

vs_even=vs[1::2]
c_even=collections.Counter(vs_even) 
C2=c_even.most_common()
C2.append((0,0))
common2=C2[0][1] #最頻値の個数
common2sec=C2[1][1] #第2頻値

Ans1=len(vs_odd)-common1
Ans2=len(vs_even)-common2
Ans3=len(vs_odd)-common1sec
Ans4=len(vs_even)-common2sec

if c_odd.most_common()[0][0] == c_even.most_common()[0][0]:
    #最頻値が同じ場合
    print(min(Ans1+Ans4, Ans2+Ans3))
else:
    print(Ans1+Ans2)
while True:
    a,op,b=input().split()
    if(op=='+') print(f"{a+b}")
    else if(op==-) print(f"{a-b}")
    else if(op==*) print(f"{a*b}")
    else if(op==/) print(f"{a//b}")
    else if(op==?) break



### FIXED CODE ###

while True:
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+':
        print(f"{a+b}")
    elif op=='-':
        print(f"{a-b}")
    elif op=='*':
        print(f"{a*b}")
    elif op=='/':
        print(f"{a//b}")
    elif op=='?':
        break
n = input()
S = input().split()
q = input()
T = input().split()
cnt = 0

for i in range(T):
    if T[i] in S:
        cnt += 1

print(cnt)

### FIXED CODE ###

n = input()
S = input().split()
q = input()
T = input().split()
cnt = 0

for i in range(len(T)):
    if T[i] in S:
        cnt += 1

print(cnt)
A, B = map(int, input().split())
count = 0
for i in range(A, B + 1):
  a = str(i)
  b = a[::-1]
  count += 1 if a == b
print(count)

### FIXED CODE ###

A, B = map(int, input().split())
count = 0
for i in range(A, B + 1):
  a = str(i)
  b = a[::-1]
  if a == b:
    count += 1 
print(count)
H, W, M = map(int, input().split())

targets = []
n_target_h = [0] * H
n_target_w = [0] * W

for i in range(M):
    h, w = map(int, input().split())
    targets.append((h, w))
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1
    h_max = max(h_max, n_target_h[h - 1])
    w_max = max(w_max, n_target_w[w - 1])

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

ans = h_max + w_max - 1
for h in bomb_h:
    for w in bomb_w:
        if not (h, w) in targets:
            ans = h_max + w_max
            break
    else:
        continue
    break

print(ans)

### FIXED CODE ###

H, W, M = map(int, input().split())

targets = []
n_target_h = [0] * H
n_target_w = [0] * W

for i in range(M):
    h, w = map(int, input().split())
    targets.append((h, w))
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1

h_max = max(n_target_h)
w_max = max(n_target_w)

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

count = len(bomb_h) * len(bomb_w)
for target in targets:
    if (n_target_h[target[0] - 1] == h_max) and (n_target_w[target[1] - 1] == w_max):
        count -= 1

if count > 0:
    ans = h_max + w_max
else:
    ans = h_max + w_max - 1

print(ans)
from fractions import gcd

N = int(input())
T = []
for i in range(N):
  T.append(long(input()))

res = 1L
for t in T:
  res = long(res * t /(gcd(res, t)))
print(res)

### FIXED CODE ###

from fractions import gcd

N = int(input())
T = []
for i in range(N):
  T.append(int(input()))

res = 1
for t in T:
  res = res // gcd(res, t) * t
print(res)
for i in range(1,10):
    for j in range(1, 10):
        print i + "x" + j "=" +i*j

### FIXED CODE ###

for i in range(1, 10):
     for j in range(1,10):
         print str(i) + "x" + str(j) + "=" + str(i*j)
import sys
sys.setrecursionlimit(10**6)

n = int(input())
#b = list(map(int, input().split()))
#n, m = map(int, input().split())
C = 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)]

C = list(C)

d = {}
tot = 0

for i,c in enumerate(C):
    if c == 'R':
        tot += 1
    d[i+1] = tot

ans = tot-d[tot]
print(ans)

# left = 0
# left2mid = False
# mid = 0
# right = 0
# right2mid = False

# lp = 0
# rp = -1

# while lp < len(C)+rp:
#     if not left2mid and C[lp] == 'W':
#         left += 1
#     elif not left2mid and C[lp] == 'R':
#         left2mid = True
#     elif left2mid and C[lp] == 'R':
#         mid += 1
#     lp += 1

#     if not right2mid and C[rp] == 'R':
#         right += 1
#     elif not right2mid and C[rp] == 'W':
#         right2mid = True
#     elif right2mid and C[lp] == 'R':
#         mid += 1
#     rp -= 1
# print(left, mid, right)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
C = input()

C = list(C)

d = {0:0}
tot = 0

for i,c in enumerate(C):
    if c == 'R':
        tot += 1
    d[i+1] = tot

ans = tot-d[tot]
print(ans)
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print(Yes)
else:
  print(No)
  


### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
N, M = map(int, raw_input().split())

for i in range((M//N)+1, 0, -1):
    if M % i == 0:
        print i
        break


### FIXED CODE ###

N, M = map(int, input().split())

output = 1
for i in range(M//N, 0, -1):
    if M % i == 0 and output < i:
        output = i
        break
print(output)
import math
n,d = list(map(int, input().split()))
x = [list(map(int, input().split())) for N in range(n)]
 
cnt = 0
 
for i in range(n):
  for j in range(i+1,n):
    kaijou = 0
    for k in d:
      kaijou = kaijou + abs(x[j][k]-x[i][k])**2
    if math.sqrt(kaijou).is_integer():
      cnt += 1
      
print(cnt)

### FIXED CODE ###

n,a,b = map(int,input().split())
print(min(n*a,b))
a = int(raw_input())
b = int(raw_input())
ans = 0
for x in range(a,b+1):
  q = str(x)
  if q[0:2] == q[3:5]:
    ans += 1
print ans


### FIXED CODE ###

a,b = map(int,raw_input().split(" "))
ans = 0
for x in range(a,b+1):
  q = str(x)
  if q[0:2] == q[3:5][::-1]:
    ans += 1
print ans
n = int(input())
s = list(map(int,input().split()))
ans=[0 for _ in range(n-1)]
for i in range(n-1):
    j=i
    while(j<n-1):
        if(s[j]>=s[j+1]):
            ans[i]+=1
            j+=1
        else:
            break
        
print(max(ans))

### FIXED CODE ###

def main():
    n = int(input())
    s = list(map(int,input().split()))
    ans=0
    point=-1
    for i in range(n-1):
        mark=0
        if i > point and i + ans < n:
            for j in range(n-i-1):
                if s[i+j]>=s[i+j+1]:
                    mark+=1
                    if mark>=ans:
                        ans=mark
                else:
                    if mark>=ans:
                        ans=mark
                        point=i+j
                    break
    print(ans)
main()
def f(s):
    if len(s)==0:
        print("YES")
        exit()
    elif 1<=len(s)<=4:
        print("NO")
        exit()
    else:
        if s[0:5]=="maerd" or s[0:5]=="esare":
            s=s[5:]
            f(s)
        elif len(s)==5:
            print("NO")
            exit()
        elif s[0:6]=="resare":
            s=s[6:]
            f(s)
        elif len(s)==6:
            print("NO")
            exit()
        elif s[0:7]=="remaerd":
            s=s[7:]
            f(s)
        else:
            print("NO")
            exit()
S=input()
S=S[::-1]
f(S)

### FIXED CODE ###

s=input()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("dream","")
if s=="":print("YES")
else:print("NO")
n = input()
for i in range(i,n+1):
    if i**2 > n:
        print((i-1)**2)
        exit()
    elif i**2 == n:
        print(i**2)
        exit()
        

### FIXED CODE ###

n = int(input())
l = []
for i in range(1,n+1):
    for j in range(2,100):
        if i**j <= n:
            l.append(i**j)
print(max(l))
N = int(input())
S = input()

ans = []
for i in range(N, len(S)):
    ans.append(S[i])

for i in range(N):
    ans.append(S[i])

print(''.join(ans))

### FIXED CODE ###

N = int(input())
S = input()

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
di = {}
for i in range(len(alp)):
    di[alp[i]] = i
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
# N = N % len(S)

ans = []
for s in S:
    ans.append(alp[di[s]+N])

print(''.join(ans))
b=input()
b=input()

if b=='A':
  print('T')
elif b=='T':
  print('A')
elif b=='C':
  print('G')
elif b=='G':
  pring('C')

### FIXED CODE ###

b=input()

if b=='A':
  print('T')
elif b=='T':
  print('A')
elif b=='C':
  print('G')
elif b=='G':
  print('C')
n = int(input())
k = int(input())

if n % k == 0 :
    print(0)
else:
    print(1)



### FIXED CODE ###

nums = [int(i) for i in input().split()]

if nums[0] % nums[1] == 0 :
    print(0)
else:
    print(1)
n=int(input())
d=list(map(int,input().split()))
d.sorted()
print(d[n/2]-d[n/2-1])

### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
d.sort()
print(d[n//2]-d[n//2-1])
import math
a, b = map(int,input().split())
gcd = math.gcd(a,b)
count = 1
if gcd % 2 == 0:
    count += 1
if gcd % 3 == 0:
    count += 1


def hantei(num):
    flag = True
    for i in range(2, int(math.sqrt(num)+1)):
        if num % i == 0:
            flag = False
    return flag


for i in range(5, gcd + 1):
    if gcd % i == 0 and hantei(i) == True:
        count += 1
print(count)


### FIXED CODE ###

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

a, b = map(int,input().split())
g = gcd(a,b)
count = 0
for i in range(2, int(g**0.5)+2):
    if g % i == 0:
        count += 1
        while g % i == 0:
            g //= i
if g != 1:
    count += 1
print(count+1)
# coding: utf-8
# Your code here!

n,m,x=map(int,input().split())
a=[int(i) for i in input().split()]
a.sort()
b=[1 for s in a if s<x]
c=sum(a)-b
print(min(b,c))

### FIXED CODE ###

n,m,x=map(int,input().split())
a=[int(i) for i in input().split()]
a.sort()
b=len([1 for s in a if s<x])
c=len(a)-b
print(min(b,c))
a, b = [int(i) for i in input().split()]

if a >= 13:
	print(B)
elif a >= 6:
	print(B/2)
else:
	print(0)

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

if a >= 13:
	print(b)
elif a >= 6:
	print(int(b/2))
else:
	print(0)
n = int(input())
p = map(int, input().split())

for i in range(1, n+1):
  if p[i-1] != i:
    count += 1
    
if count == 0 or count == 2:
  print("YES")
else:
  print("No")

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
count = 0

for i in range(1, n+1):
  if p[i-1] != i:
    count += 1
    
if count == 0 or count == 2:
  print("YES")
else:
  print("NO")
# -*- coding: utf-8 -*-
def inpl(): return map(int, input().split())
N = int(input())
balls = [input().replace(" ", "") for _ in range(2*N)] + ["END"]

B = ["END"] + ["B{}".format(i) for i in range(1, N+1)[::-1]]
W = ["END"] + ["W{}".format(i) for i in range(1, N+1)[::-1]]

ans = 0
for i in range(2*N):
    b = balls.index(B[-1])
    w = balls.index(W[-1])
    if b < w:
        if b != i:
            ans += b-i
            del balls[b]
            balls.insert(i, B[-1])
        B.pop()
    else:
        if w != i:
            ans += w-i
            del balls[w]
            balls.insert(i, W[-1])
        W.pop()

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
def inpl(): return map(int, input().split())
S = input()
K = int(input())
ans = set()

for s in sorted(set(S)):
    if len(ans) >= K:
        break
    for i in range(len(S)):
        if S[i] == s:
            for k in range(K):
                ans.add(S[i:i+k+1])

print(sorted(ans)[K-1])
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
from math import factorial
chars = ["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"]
result = []
for n in range(N):
    res = {}
    for char in chars:
        res[char] = S[n].count(char)
    result.append(res)
result2 = Counter([str(i) for i in result ])
cnt = 0
for key in result2.keys():
    if result2[key] == 1:
        pass
    else:
        comb = factorial(result2[key]) / factorial(2) / factorial(result2[key] - 2)
        cnt += comb
print(int(cnt))

### FIXED CODE ###

from scipy.misc import comb
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
chars = ["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"]
result = []
for n in range(N):
    res = {}
    for char in chars:
        res[char] = S[n].count(char)
    result.append(res)
result2 = Counter([str(i) for i in result ])
cnt = 0
for key in result2.keys():
    if result2[key] == 1:
        pass
    else:
        cnt += comb(result2[key],2,exact=True)
print(int(cnt))
nnn = int(input())

a = [-2 for i in range(nnn)]
a[0] = 0

def m():
	return map(int,input().split())


def oon(x,n,nn,k):
	global a
	for i in range(len(x[n])):
		if x[n][i][0] != nn and a[nn] != -2 and a[a[x[n][i][0]]] == -2:
			p = (k + x[n][i][1]) % 2
			if p == 0:
				a[x[n][i][0]] = 0
			else:
				a[x[n][i][0]] = 1
			oon(x,x[n][i][0],n,p)



b = [[] for i in range(nnn)]

for i in range(nnn-1):
	z,y,c = m();
	b[z-1].append([y-1,c])
	b[y-1].append([z-1,c])

oon(b,0,0,0)

for i in range(nnn):
	print(a[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
nnn = int(input())

a = [-2 for i in range(nnn)]
a[0] = 0

def m():
	return map(int,input().split())


def oon(x,n,nn,k):
	global a
	for i in range(len(x[n])):
		if x[n][i][0] != nn and a[nn] != -2:
			p = (k + x[n][i][1]) % 2
			if p == 0:
				a[x[n][i][0]] = 0
			else:
				a[x[n][i][0]] = 1
			oon(x,x[n][i][0],n,p)



b = [[] for i in range(nnn)]

for i in range(nnn-1):
	z,x,c = m();
	b[z-1].append([x-1,c])
	b[x-1].append([z-1,c])

oon(b,0,0,0)

for i in range(nnn):
	print(a[i])
import fractions
n = int(input())
a = list(map(int, input().split()))
m = 0
ans = 0

for i in range(n):
  m = fractions.lcm(m, a[i])
m -= 1

for i in range(n):
  ans += m%a[i]

print(ans)

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
m = 0
ans = 0

for i in range(n):
  m = m*a[i]//fractions.gcd(m, a[i])
m -= 1

for i in range(n):
  ans += m%a[i]

print(ans)
n = int(input()))
M = [[0] * n in  range (n)]
for i in range(n):
    u = list(map(int, input().split()))
    v = u[0]
    for j in u[2:]:
        M[v - 1][j - 1] = 1

for i in M:
    print(*i)

### FIXED CODE ###

n = int(input())
M = [[0] * n for i in range (n)]
for i in range(n):
    u = list(map(int, input().split()))
    v = u[0]
    for j in u[2:]:
        M[v - 1][j - 1] = 1

for i in M:
    print(*i)
if "Lucida Grande"+"Lucida Grande"+"Lucida Grande">=22:
  print(win)
else:
  print(bust)

### FIXED CODE ###

A1,A2,A3=map(int,input().split())

if A1+A2+A3>=22:
  print("bust")
else:
  print("win")
a=int(input())
b,c=map(int,input().split())
d=0
for i in range():
  e=(b//(int(input()))+1
  d+=e
  print(d+c)

  
  

### FIXED CODE ###

a=int(input())
b,c=map(int,input().split())
d=0
while d<a:
  e=((b-1)//int(input()))+1
  c+=e
  d+=1
print(c)
n,k,x,y = map(int, input())
if n > k:
  sum = k*x+(n-k)*y
else:
  sum = n*x
print(sum)

### FIXED CODE ###

N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N >= K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)
n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = True
    for j in range(n):
        if (i >> j) & 1:
            s[j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[l])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = False
    if case is True:
        ans = max(ans, cnt)
print(ans)


### FIXED CODE ###

n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = 0
    for j in range(n):
        if (i >> j) & 1:
            s[n - 1 - j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[k])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = 1
    if case == 0:
        ans = max(ans, cnt)
print(ans)
n=map(int,raw_input().split())
if n[0]<n[1]:
	print str(n[0])+"<"str(n[1])
elif n[0]>n[1]:
	print str(n[0])+">"str(n[1])
else:
	print str(n[0])+"=="+str(n[1])

### FIXED CODE ###

n=map(int,raw_input().split())
if n[0]<n[1]:
	print "a < b"
elif n[0]>n[1]:
	print "a > b"
else:
	print "a == b"
import math
l = input().split()
x1 = int(l[0])
y1 = int(l[1])
x2 = int(l[2])
y2 = int(l[3])

a = pow((x2 - x1), 2) + pow((y2 - y1), 2)
ans = math.sqrt(a)
print("{0:.8f}".format(ans))

### FIXED CODE ###

import math
l = input().split()
x1 = float(l[0])
y1 = float(l[1])
x2 = float(l[2])
y2 = float(l[3])

a = pow((x2 - x1), 2) + pow((y2 - y1), 2)
ans = math.sqrt(a)
print(ans)
from collections import deque

H, W = map(int, input().split())
matrix = [input() for _ in range(H)]
(sy, sx) = (0, 0)
(gy, gx) = (H - 1, W - 1)

dist = [[None for _ in range(W)] for _ in range(H)]

q = deque([(sy, sx)])
dist[sy][sx] = 1

count_dots = 0
for i in range(H):
    count_dots += matrix[i].count(".")

while q:
    cy, cx = q.popleft()
    if (cy, cx) == (gy, gx):
        break

    for (dy, dx) in ((0, 1), (1, 0), (0, -1), (-1, 0)):
        ny, nx = cy + dy, cx + dx

        if 0 <= nx < W and 0 <= ny < H and matrix[ny][nx] == ".":
            if dist[ny][nx] is None:
                q.append((ny, nx))
                dist[ny][nx] = dist[cy][cx] + 1

print(count_dots - dist[gy][gx])

### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
matrix = [input() for _ in range(H)]
(sy, sx) = (0, 0)
(gy, gx) = (H - 1, W - 1)

dist = [[None for _ in range(W)] for _ in range(H)]

q = deque([(sy, sx)])
dist[sy][sx] = 1

count_dots = 0
for i in range(H):
    count_dots += matrix[i].count(".")

while q:
    cy, cx = q.popleft()
    if (cy, cx) == (gy, gx):
        break

    for (dy, dx) in ((0, 1), (1, 0), (0, -1), (-1, 0)):
        ny, nx = cy + dy, cx + dx

        if 0 <= nx < W and 0 <= ny < H and matrix[ny][nx] == ".":
            if dist[ny][nx] is None:
                q.append((ny, nx))
                dist[ny][nx] = dist[cy][cx] + 1

if dist[gy][gx] is None:
    print(-1)
    exit()

print(count_dots - dist[gy][gx])
N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)

A.sort()
B.sort()

if N%2 == 1:
    print(B[N//2][1]-A[N//2][0]+1)
else:
    r = (B[N//2-1][1]+B[N//2][1])
    l = (A[N//2-1][0]+A[N//2][0])
    print(r-l+1)

### FIXED CODE ###

N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)

A.sort()
B.sort()

if N%2 == 1:
    print(B[N//2]-A[N//2]+1)
else:
    r = (B[N//2-1]+B[N//2])
    l = (A[N//2-1]+A[N//2])
    print(r-l+1)
print(target[int(input()) - 1])

### FIXED CODE ###

target = [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(target[int(input()) - 1])
import fractions
def lcm(C,D):
    return C*D/fractions.gcd(C,D)
A,B,C,D = map(int, input().split())
X = B - A
print(X - int(X/C) - int(X/D) + int(X/(C*D/math.gcd(C,D))))

### FIXED CODE ###

import fractions
def lcm(C,D):
    return C*D//fractions.gcd(C,D)
A,B,C,D = map(int, input().split())
b = (B - B//C - B//D + B//lcm(C,D))
a = ((A-1) - (A-1)//C- (A-1)//D + (A-1)//lcm(C,D))
print(b-a)
import sys

#readline = sys.stdin.readline
_input = open('input')
readline = _input.readline

H, W = map(int, readline().split())
S = [readline().rstrip() for i in range(H)]

vert = [[0]*W for i in range(W)]
hori = [[0]*W for i in range(W)]

for y in range(H):
    for x in range(W):

        if x > 0 and S[y][x - 1] != '#':
            hori[y][x] = hori[y][x - 1]
        elif S[y][x] == '#':
            hori[y][x] = 0
        else:
            # hori
            count = 1
            while x + count < W and S[y][x + count] == '.':
                count += 1
            hori[y][x] = count

        if y > 0 and S[y - 1][x] != '#':
            vert[y][x] = vert[y - 1][x]
        elif S[y][x] == '#':
            vert[y][x] = 0
        else:
            # hori
            count = 1
            while y + count < H and S[y + count][x] == '.':
                count += 1
            vert[x][y] = count

ans = 0
for y in range(H):
    for x in range(W):
        a = hori[y][x] + vert[y][x] - 1
        ans = max(a, ans)

print(ans)

### FIXED CODE ###

import sys

readline = sys.stdin.readline

H, W = map(int, readline().split())
S = [readline().rstrip() for i in range(H)]

vert = [[0]*W for i in range(H)]
hori = [[0]*W for i in range(H)]

for y in range(H):
    for x in range(W):

        if x > 0 and S[y][x - 1] != '#':
            hori[y][x] = hori[y][x - 1]
        elif S[y][x] == '#':
            hori[y][x] = 0
        else:
            # hori
            count = 1
            while x + count < W and S[y][x + count] == '.':
                count += 1
            hori[y][x] = count

        if y > 0 and S[y - 1][x] != '#':
            vert[y][x] = vert[y - 1][x]
        elif S[y][x] == '#':
            vert[y][x] = 0
        else:
            # hori
            count = 1
            while y + count < H and S[y + count][x] == '.':
                count += 1
            vert[y][x] = count

ans = 0
for y in range(H):
    for x in range(W):
        a = hori[y][x] + vert[y][x] - 1
        ans = max(a, ans)

print(ans)
n=int(input())
h=list(map(int,input().split()))
print(count(max(h[:i]+[0])<=h[i]for i in range(n)))

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
print(sum(max(h[:i]+[0])<=h[i]for i in range(n)))
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
 
if (N < M):
	print("-1")
else:
	sum = 0
    for i in range(M):
    	sum = sum + A[i]
    if(sum <= N):
    	sub = sum-N
        print(sub)
   	else:
    	print("-1")

### FIXED CODE ###

r = int(input())

K = 3.14159265358979*2*r

print(K)
A = input("X=?")
B = input("Y=?")
C = input("Z=?")
x = A
A = B
B = x
x = A
A = C
C = x
print(%d %d %d %(A,B,C))

### FIXED CODE ###

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

print(' '.join(map(str, [A,B,C])))
n = int(input())

p=1
for i in range(1, n+1):
    p = i*(p % (10**9 + 7)) 

print(p

### FIXED CODE ###

import math
n = int(input())

print(math.factorial(n) % (10**9+7))