Harryxun/stf_run huggingface dataset:
W, H, x, y = map(int, input().split())

if W / x == 2 and H / y == 2:
    print(W * H / 2, 1)
elif W / x == 2 or H / y == 2:
    print(W * H / 2, 0 )
else:
    h = max(x, W - x)
    w = max(y, H - y)
    print(H/h * W/w /2)
    

### FIXED CODE ###

W, H, x, y = map(int, input().split())

"""
直方体は中身を通る線で半分に割ることができる
"""

if W/2 == x and H/2 == y:
    print(W * H / 2, 1)
else:
    print(W * H / 2, 0)
i = 1

while True:
  x = input()
  if x == "0":
    break
  print ("Case " + str(i) + ": " + str(x))
  i += 1


### FIXED CODE ###

while True:
  x,y = (int(x) for x in input().split())

  if x == 0 and y == 0:
    break
  if x < y:
    print (str(x) + " " + str(y))
  else:
    print (str(y) + " " + str(x))
def div(n):
    ans = 0
    while n % 2 == 0:
        n /= 2
        ans+=1
    return ans

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

ans = min(map(div,list))

print(ans)


### FIXED CODE ###

print(input().count("1"))
D,G=map(int,raw_input().split())

P=[map(int,raw_input().split()) for i in range(D)]

S=6000

dp=[ [ float("inf") for i in range(S)]  for j in range(D) ] 
a=P[0][0]
b=P[0][1]/100

for i in range(a+1):
	if i==a: dp[0][i+b]=i
	else: dp[0][i]=i

for j in range(D): dp[j][0]=0


for i in range(1,D):
	a=P[i][0]
	b=P[i][1]/100


	for s in range(S):
		for k in range(1,a):
			if s-(k*(i+1)) >=0:
				dp[i][s]=min( dp[i-1][s-(k*(i+1))]+k, dp[i-1][s] )
		if s-( a*(i+1)+b )>=0:
			dp[i][s]=min( dp[i-1][s-( a*(i+1)+b ) ]+a, dp[i-1][s] )

	
ans=float("inf")
for i in range(G/100,S):
	ans=min(ans,dp[D-1][i] )

print ans



### FIXED CODE ###

D,G=map(int,raw_input().split())

A=[map(int,raw_input().split()) for i in range(D)]

N=1000
dp=[ [ float("-inf") for i in range(N+100)]  for j in range(D) ] 

p=A[0][0]
c=A[0][1]


for i in range(1,p+1):
	if i==p: dp[0][i]=i*100+c
	else: dp[0][i]=i*100

for i in range(D):
	dp[i][0]=0



for k in range(1,D):
	p=A[k][0]    # number of problems per line
	c=A[k][1]    # bonus

	for i in range(N):		         #dp[k][i]
		for j in range(1,p+1):    #number of problems per line
			dp[k][i+j]=max( dp[k][i+j], dp[k-1][i]+j*(k+1)*100, dp[k-1][i+j] )
		dp[k][i+j]=max( dp[k][i+j], dp[k-1][i]+j*(k+1)*100+c,dp[k-1][i+j] )



for idx,i in enumerate(dp[D-1]):
	if i>=G:
		print idx
		quit()
import math
total = 0
for a in range(K):
  for b in range(K):
    for c in range(K):
      total += math.gcd(a, b)
print(total)

### FIXED CODE ###

import math

K = int(input())
total = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    ab = math.gcd(a, b)
    for c in range(1, K+1):
      total += math.gcd(ab, c)
print(total)
cnt = 0
for a in range(A+1):
#     _a = a*500
    for b in range(B+1):
#         _b = b*100 + _a
#         if _b > X: break
        for c in range(C+1):
#             _c = c*50 + _a + _b
#             if _c > X: break
#             if _c == X:
            if (a*500 + b*100 + c*50) == X:
                cnt+=1
print(cnt)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if (a*500 + b*100 + c*50) == X:
                cnt+=1
print(cnt)
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n, = map(int,readline().split())
*a, = map(int,readline().split())
*b, = map(int,readline().split())
b = b[::-1]

from collections import Counter
d = Counter(a+b)
if max(d.values()) > n:
    print("No")
    exit()

same = set(i for i in range(n) if a[i]==b[i])
from random import randrange
while same:
    i = same.pop()
    while True:
        j = randrange(0,n)
        if a[j] != b[i] and a[i] != b[j]:
            b[i],b[j] = b[j],b[i]
            same.discard(j)
            break

print("Yes")
print(*b)


### FIXED CODE ###

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

x, = map(int,read().split())
print(1-x)
#coding:utf-8
import math

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

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 0

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

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

### FIXED CODE ###

#coding:utf-8
import math

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

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP=P):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim+1:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N)
print(1)

### FIXED CODE ###

S = input()
n = 0
for i in S:
    if i == '2':
        n += 1
print(n)
n=int(input())
a=list(map(float,input().split()))
dp={}

def foo(i,h,t,p):
	if i==n-1:
		if h>t:
			return p
		else:
			return 0
	return foo(i+1,h+1,t,p*a[i+1])+foo(i+1,h,t+1,p*(1-a[i+1]))

print(foo(-1,0,0,1))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

n=int(input())
a=list(map(float,input().split()))
dp=[[0.0 for _ in range(n+1)] for _ in range(n+1)]
dp[1][1]=a[0]
dp[1][0]=1-a[0]
 
for i in range(2, n+1):
    for j in range(i+1):
        dp[i][j]=a[i - 1] * dp[i - 1][j - 1]+(1 - a[i - 1])*dp[i - 1][j]
 
print(sum(dp[n][n // 2 + 1:]))
a,b,k = map(int,input().split())
s = set(range(a,a+k))
t = set(range(b-k+1,b+1))
u = sorted(s|t)
for i in u: if a<=i<=b: print(i)

### FIXED CODE ###

a,b,k = map(int,input().split())
s = set(range(a,a+k))
t = set(range(b-k+1,b+1))
u = sorted(s|t)
for i in u:
    if a<=i<=b: print(i)
def dfs(si, t):
    for subs in ['dream', 'dreamer', 'erase', 'eraser']:
        if si + len(subs) <= N and S[si:si + len(subs)] == subs:
            if si + len(subs) == N:
                print('Yes')
                exit()
            else:
                dfs(si + len(subs), t + subs)


S = input()
N = len(S)
dfs(0, '')
print('No')


### FIXED CODE ###

S = input()
lenS = len(S)

i=0
while i < lenS:
  if S[i:i+5] =='dream':
    i+=5
    if S[i:i+2] == 'er' and S[i:i+5] != 'erase':i+=2
  elif S[i:i+6] == 'eraser': i+=6
  elif S[i:i+5] == 'erase': i+=5
  else:
    print('NO')
    exit()
print('YES')
S = list(input())
#勝利数
win = S.count("o")
#これから勝つ必要のある試合
korekara = 8 - win
#戦った試合
match = len(S)
#残り試合
nokori = 15 - match

if korekara <= 8:
    print("YES")
elif nokori => korekara:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

S = list(input())

#勝利数
win = S.count("o")
#これから勝つ必要のある試合
korekara = 8 - win
#戦った試合
match = len(S)
#残り試合
nokori = 15 - match

if korekara <= 0:
    print("YES")
elif nokori >= korekara:
    print("YES")
else:
    print("NO")
h = 'A B C D'
list = h.split(' ')

taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')

### FIXED CODE ###

import math
A, B, C, D = map(int, input().split())
if math.ceil(C/B) <= math.ceil(A/D):
  print('Yes')
else:
  print('No')
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline


def cnt1(i, oya_i=0):
    if len(pair[i]) == 1 and oya_i:
        memo[i][oya_i] = 1
        return 1

    if memo[i][oya_i] != -1:
        return memo[i][oya_i]

    re = 1
    for ko_i in pair[i]:
        if ko_i == oya_i: continue
        re *= (cnt1(ko_i, i) + 1)
    memo[i][oya_i] = re = re % m
    return re


def cnt2(i, ko_i=0, cnt_ko=-1):
    if cnt_ko != -1:
        memo[ko_i][i] = cnt_ko

    oyas = pair[i]
    oya_n = len(oyas)
    ruisekiL = [1] * (oya_n)
    ruisekiR = [1] * (oya_n)
    for k in range(1, oya_n):
        ruisekiL[k] = ruisekiL[k - 1] * (memo[oyas[k - 1]][i] + 1) % m
        ruisekiR[-k - 1] = ruisekiR[-k] * (memo[oyas[-k]][i] + 1) % m

    ans[i] = ruisekiL[-1] * (memo[oyas[-1]][i] + 1) % m

    for k, oya_i in enumerate(oyas):
        if oya_i == ko_i: continue
        cnt2(oya_i, i, ruisekiL[k] * ruisekiR[k] % m)


n, m = map(int, input().split())
memo = [[-1] * (n + 1) for _ in range(n + 1)]
pair = [[] for _ in range(n + 1)]
for _ in range(n - 1):
    x, y = map(int, input().split())
    pair[x] += [y]
    pair[y] += [x]
ans = [0] * (n + 1)

cnt1(1)
cnt2(1)

print(*ans[1:], sep="\n")


### FIXED CODE ###

from collections import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

n, m = MI()
to = defaultdict(list)
# dp[u][v] uを根としたときのサブツリーvの値
dp = {}

def dfs(u=0, pu=-1):
    res = 1
    for v in to[u]:
        if v == pu: continue
        res *= dfs(v, u) + 1
        res %= m
    if pu != -1: dp[(pu,u)] = res
    return res

def main():
    for _ in range(n - 1):
        x, y = map(int1, input().split())
        to[x].append(y)
        to[y].append(x)
    dfs()
    # bfsでdfsとは逆向きのdpを完成させる
    que = deque()
    que.append([0, -1])
    while que:
        u, pu = que.popleft()
        tn = len(to[u])
        # 累積積のための配列
        ll = [0] * tn
        rr = [0] * tn
        # uのサブツリーの値+1を入れる
        for i, v in enumerate(to[u]):
            ll[i] = rr[i] = dp[(u,v)] + 1
        # 左右から累積積を作る
        for i in range(1, tn):
            ll[i] = (ll[i - 1] * ll[i]) % m
            rr[tn - 1 - i] = (rr[tn - i] * rr[tn - 1 - i]) % m
        # 配列の最初or最後のために最後に1を追加
        ll += [1]
        rr += [1]
        # uの子vを根とみたときのサブツリーuの値を求める
        for i, v in enumerate(to[u]):
            if v == pu: continue
            dp[(v,u)] = (ll[i - 1] * rr[i + 1]) % m
            que.append([v, u])
    # p2D(dp)
    # 各頂点について答えを出す
    for u in range(n):
        ans = 1
        for v in to[u]:
            ans = (ans * (dp[(u,v)] + 1)) % m
        print(ans)

main()
H,W = map(int,input().split())
a = [[x for x in input()] for i in range(H)]
f = True
if a[0][0] == "#":
    if a[0][1] == "." and a[1][0] == ".":
        print("No")
        f = False
if a[0][-1] == "#":
    if a[0][-2] == "." and a[1][-1] == ".":
        print("No")
        f = False
if a[-1][0] == "#":
    if a[-1][1] == "." and a[-2][0] == ".":
        print("No")
        f = False
if a[-1][-1] == "#":
    if a[-1][-2] == "." and a[-2][-1] == ".":
        print("No")
        f = False
for i in range(1,H-1):
    if a[0][i] == "#":
        if a[0][i-1] == "." and a[0][i+1] == "." and a[1][i] == ".":
            print("No")
            f = False
            break
    elif a[-1][i] == "#":
        if a[-1][i-1] == "." and a[-1][i+1] == "." and a[-2][i] == ".":
            print("No")
            f = False
            break
for i in range(1,W-1):
    if a[i][0] == "#":
        if a[i-1][0] == "." and a[i+1][0] == "." and a[i][1] == ".":
            print("No")
            f = False
            break
    if a[i][-1] == "#":
        if a[i-1][-1] == "." and a[i+1][-1] == "." and a[i][-2] == ".":
            print("No")
            f = False
            break
    if f:
        for i in range(1,H-1):
            for j in range(1,W-1):
                if a[i][j] == "#":
                    if a[i][j+1] == "." and a[i][j-1] == "." and a[i+1][j] == "." and a[i-1][j] == ".":
                        print("No")
                        f = False
                        break
                        break
if f:
    print("Yes")

### FIXED CODE ###

H,W = map(int,input().split())
a = [["."]*(W+2)]*(H+1)
f = True
for i in range(H):
    a[i+1] = ["."]
    a[i+1].extend([x for x in input()])
    a[i+1].append(".")
a.append(["."]*(W+2))
for i in range(1,H+1):
    for j in range(1,W+1):
        if a[i][j] == "#":
            if a[i][j+1] == "." and a[i][j-1] == "." and a[i+1][j] == "." and a[i-1][j] == ".":
                f = False
                break
                break
if f:
    print("Yes")
else:
    print("No")
import numpy as np
import copy

N= int(input())
S=input()
SS= copy.copy(S)
S = list(S)
#N, A, B = map(int, input().split())

flag = 1
print(len(S))
while flag == 1:
    flag = 0
    flag2 = 1
    i = 0
    while flag2:
    # for i in range(len(S)-1):
        print(i)
        if S[i]=="(" and S[i+1] ==")":
            flag = 1
            del S[i] 
            del S[i+1]
            i -= 2
        i += 1
        i = max(0,i)
        if i>len(S):
            flag2 = 0
a=0
b=0
for i in range(len(S)):
    if S[i]=="(":
        b+=1
    elif S[i]==")":
        a+=1
print(S)
# initialization of string to ""
A = ""
B = ""

# traverse in the string
for x in range(a):
    
    A += "("   
for x in range(b):    
    B += ")"   

        
#print(str(A)+SS+str(B))
print(A+SS+B)
    


### FIXED CODE ###

import numpy as np
import copy

N= int(input())
S=input()
SS= copy.copy(S)
S = list(S)
#N, A, B = map(int, input().split())

flag = 1
#print(len(S))
while flag == 1:
    flag = 0
    flag2 = 1
    i = 0
    while flag2 and len(S)>1:
    # for i in range(len(S)-1):
        #print(S)
        if S[i]=="(" and S[i+1] ==")":
            # print(S, i)
            flag = 1
            del S[i] 
            del S[i]
            i -= 1
            # print(S, i)
        i += 1
        i = max(0,i)
        if i+1>=len(S):
            flag2 = 0
a=0
b=0
for i in range(len(S)):
    if S[i]=="(":
        b+=1
    elif S[i]==")":
        a+=1
#print(S)
# initialization of string to ""
A = ""
B = ""

# traverse in the string
for x in range(a):
    
    A += "("   
for x in range(b):    
    B += ")"   

        
#print(str(A)+SS+str(B))
print(A+SS+B)
x=map(int,input().split())
 
for i in range(5):
    if x[i]==0:
        print(i+1)

### FIXED CODE ###

a, b, c, d, e = map(int,input().split())

if a == 0:
  print(1)
elif b == 0:
  print(2)
elif c == 0:
  print(3)
elif d == 0:
  print(4)
elif e == 0:
  print(5)
x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
aa=sorted(a,reverse=True)
bb=sorted(b,reverse=True)
cc=sorted(c,reverse=True)
n=0
l=[]
while n<=k:
    for i in range(15):
        for j in range(15):
            for x in range(15):
                ll=l.append(aa[i]+bb[j]+cc[x])
ll.sort(reverse=True)
for i in range(k):
    print(ll[i])


### FIXED CODE ###

x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=sorted(list(map(int,input().split())),reverse=True)
ab=[]
for i in a:
    for j in b:
        ab.append(i+j)
ab.sort(reverse=True)
ans=[]
for i in range(min(k,len(ab))):
    for j in range(min(k,len(c))):
        ans.append(ab[i]+c[j])
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])
s = input()
n = len(s)

if n == 1:
  p = 1
else:
  p = n//2
d = 0
for i in range(p):
  if s[2*i] == "L" or s[2*i+1] == "R":
    print("No")
    d = 1
    break

if d == 0:
  print("Yes")

### FIXED CODE ###

s = input()
n = len(s)

k = s[0::2]
g = s[1::2]

d = 0

for i in range(len(k)):
  if k[i] == "L":
    print("No")
    d = 1
    break

if d == 0:
  for i in range(len(g)):
    if g[i] == "R":
      print("No")
      d = 1
      break
if d == 0:
  print("Yes")
def main():
    h, w, k = map(int, raw_input().split())
    c = [map(int, raw_input().strip()) for _ in xrange(h)]
    def go(a):
        if not res:
            return 0
        return go(a) * 2 + res
    ans = 0
    for ii in xrange(h):
        for jj in xrange(w):
            a = [c[i][:] for i in xrange(h)]
            a[ii][jj] = 0
            r = 0
            e = 1
            while res:
                for j in xrange(w):
                    st = [a[i][j] for i in xrange(h) if a[i][j]]
                    for i in xrange(h):
                        a[i][j] = 0
                    i = -1
                    for x in reversed(st):
                        a[i][j] = x
                        i -= 1
                res = 0
                for i in xrange(h):
                    j = 0
                    while j < w:
                        t = j + 1
                        while t < w and a[i][j] == a[i][t]:
                            t += 1
                        if t - j >= k:
                            for j in xrange(j, t):
                                res += a[i][j]
                                a[i][j] = 0
                        j = t
                if not res:
                    break
                r += res * e
                e *= 2
            if ans < r:
                ans = r
    print ans
main()


### FIXED CODE ###

def main():
    h, w, k = map(int, raw_input().split())
    c = [map(int, raw_input().strip()) for _ in xrange(h)]
    def go(a):
        if not res:
            return 0
        return go(a) * 2 + res
    ans = 0
    for ii in xrange(h):
        for jj in xrange(w):
            a = [c[i][:] for i in xrange(h)]
            a[ii][jj] = 0
            r = 0
            e = 1
            while 1:
                for j in xrange(w):
                    st = [a[i][j] for i in xrange(h) if a[i][j]]
                    for i in xrange(h):
                        a[i][j] = 0
                    i = -1
                    for x in reversed(st):
                        a[i][j] = x
                        i -= 1
                res = 0
                for i in xrange(h):
                    j = 0
                    while j < w:
                        t = j + 1
                        while t < w and a[i][j] == a[i][t]:
                            t += 1
                        if t - j >= k:
                            for j in xrange(j, t):
                                res += a[i][j]
                                a[i][j] = 0
                        j = t
                if not res:
                    break
                r += res * e
                e *= 2
            if ans < r:
                ans = r
    print ans
main()
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s = read().decode("utf-8").rstrip()
l = 0
r = len(s) - 1

cnt = 0
while l != r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        cnt += 1
    elif s[r] == 'x':
        r -= 1
        cnt += 1
    else:
        print(-1)
        sys.exit()

print(cnt)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s = read().decode("utf-8").rstrip()
l = 0
r = len(s) - 1

cnt = 0
while len(s) != 0:
    if s[0] == s[-1]:
        s = s[1:-1]
    elif s[0] == 'x':
        s += 'x'
        cnt += 1
    elif s[-1] == 'x':
        s = 'x' + s
        cnt += 1
    else:
        print(-1)
        sys.exit()

print(cnt)
a, b, c = map(int, input().split())

if a < b < c:
print("Yes")
else:
print("No")

### FIXED CODE ###

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

if a < b < c:
    print("Yes")
else:
    print("No")
n = [int(e) for e in input().split(" ")]
if(n[0] == n[1]):
    print(f"{n[0]}" * n[0])
elif(n[0] < n[1]):
    print(f"{n[0]}" * n[1])
else:
    print(f"{n[1]}" * n[0])

### FIXED CODE ###

n = [int(e) for e in input().split(" ")]
if(n[0] == n[1]):
    print(str(n[0]) * n[0])
elif(n[0] < n[1]):
    print(str(n[0]) * n[1])
else:
    print(str(n[1]) * n[0])
S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    safe

### FIXED CODE ###

S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")
def fact(n):
    if n==0:
        return 1
    return n*fact(n-1)
ans=0    
N=int(input())
s=list(map(int,input().split()))
t=max(s)
for i in s:
    c=fact(t)/(fact(i)*fact(t-i))
    if ans<c and t!=i:
        ans=c
        an=i
print(str(t)+" "+str(an))        


### FIXED CODE ###

N=int(input())
s=list(map(int,input().split()))
n=max(s)
s.remove(n)
q=n
for i in s:
    t=abs(n/2-i)
    if q>=t:
        q=t
        w=str(n)+" "+str(i)
print(w)
import sys

n,k = (int(i) for i in input().split())

d = [None]*k
a = [None]*n

syugou = []
for i in range(k):
    d[i] = int(input())
    a[i] = [int(j) for j in input().split()]

    syugou = syugou+a[i]
    ans = set(syugou)

num = list(ans)

print(n-len(num))

### FIXED CODE ###

import sys

n,k = (int(i) for i in input().split())

d = [None]*k
a = [None]*k

syugou = []
for i in range(k):
    d[i] = int(input())
    a[i] = [int(j) for j in input().split()]

    syugou = syugou+a[i]

num = set(syugou)

print(n-len(num))
a, b, c = map(int,input().split())
if b>a and c>a: 
  if c>b:
    print("No")
  else:
    print("Yes")
 
elif a>b and c>b:
  if a>c:
    print("Yes")
  else c<a:
    print("No)
          
 else:
   print("No")
  

### FIXED CODE ###

a,b,c=map(int,input().split())
if a<c<b:
  print("Yes")
elif b<c<a:
  print("Yes")
else:
  print("No")
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
[n,m]=i2()
e=[[] for i in range(n+1)]
for i in range(m):
 [a,b]=i2()
 e[a].append(b)
 e[b].append(a)

import sys
sys.setrecursionlimit(10000)
d=[0 for i in range(n+1)]
dd=[]
def dfs1(v):
   d[v]=1
   for i in range(len(e[v])):
      if d[e[v][i]]==0:
         dd.append(e[v][i])
         dfs1(e[v][i])
         break
ddd=[]
def dfs2(v):
   d[v]=1
   for i in range(len(e[v])):
      if d[e[v][i]]==0:
         ddd.append(e[v][i])
         dfs2(e[v][i])
         break
dfs1(1)
dfs2(1)
l=ddd[::-1]+[1]+dd
s=""
for i in l:
 s+=str(i)+" "
print(len(s.split(" "))-1)
print(s)


### FIXED CODE ###

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
[n,m]=i2()
e=[[] for i in range(n+100)]
for i in range(m):
 [a,b]=i2()
 e[a].append(b)
 e[b].append(a)

import sys
sys.setrecursionlimit(10**6)
d=[0 for i in range(n+100)]
dd=[]
def dfs1(v):
   d[v]=1
   for i in e[v]:
      if d[i]==0:
         dd.append(i)
         dfs1(i)
         break
ddd=[]
def dfs2(v):
   d[v]=1
   for i in e[v]:
      if d[i]==0:
         ddd.append(i)
         dfs2(i)
         break
dfs1(1)
dfs2(1)
l=ddd[::-1]+[1]+dd
print(len(l))
print(*l)
import itertools
n, m = map(int, input().split())
P = [input().split() for i in range(m)]
P = list(itertools.chain.from_iterable(P))
ac_list = [0] * n
wa_list = [0] * n

counta = 0
countb = 0
for i in range(1, m * 2, 2):
    if P[i] == "AC" and ac_list[int(P[i - 1])] == 0:
        counta += 1
        ac_list[int(P[i - 1])] = 1
        countb += wa_list[int(P[i - 1]) - 1]
    elif P[i] == "WA":
        wa_list[int(P[i - 1]) - 1] += 1
    else:
        continue

print(counta, countb)


### FIXED CODE ###

import itertools
n, m = map(int, input().split())
P = [input().split() for i in range(m)]
P = list(itertools.chain.from_iterable(P))
ac_list = [0] * n
wa_list = [0] * n
counta = 0
countb = 0
for i in range(1, m * 2, 2):
    if P[i] == "AC" and ac_list[int(P[i - 1])-1] == 0:
        counta += 1
        ac_list[int(P[i - 1])-1] = 1
        countb += wa_list[int(P[i - 1]) - 1]
    elif P[i] == "WA":
        wa_list[int(P[i - 1]) - 1] += 1
    else:
        continue

print(counta, countb)