Harryxun/stf_run huggingface dataset:
N = int(input())
T, A = map(int, input.split())
H = list(map(int, input.split()))

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num)


### FIXED CODE ###

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num+1)
import numpy as np
import sys
n,k = map(int,input().split())
a = list(map(int,input().split()))

b = []

for i in range(len(a) - 1):
  b.append(abs(a[i]-a[i+1]))
  
c = int(np.min(b))

for i in a:
  if abs(i-k) % c == 0:
    print("POSSIBLE")
    sys.exit()
    
print("IMPOSSIBLE")
 

### FIXED CODE ###

import numpy as np
import sys
import math
from functools import reduce
import fractions as fr

def gcd(*numbers):
    return reduce(fr.gcd, numbers)

n,k = map(int,input().split())
a = list(map(int,input().split()))

c = int(gcd(*a))

for i in a:
  if i - k >= 0 and (i-k) % c == 0:
    print("POSSIBLE")
    sys.exit()
    
print("IMPOSSIBLE")
N = int(input())
mydict = []
for i in range(1, N+1):
  a, b=input().split()
  mydict.append([str(a), int(b), i])
mydict = sorted(mydict, key=lambda x:(x[0][1]))
for i in mydict:
  print(i[2])


### FIXED CODE ###

N = int(input())
mydict = []
for i in range(1, N+1):
  a, b=input().split()
  mydict.append([str(a), int(b), i])
mydict = sorted(mydict, key=lambda x:x[1], reverse=True)
mydict = sorted(mydict, key=lambda x:x[0])
for i in mydict:
  print(i[2])
a, b = map(int, input())
if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")


### FIXED CODE ###

a, b = map(int, input().split())
if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")
import math
import copy
from copy import deepcopy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq

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

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

def getInputStr():
    inputStr = str(input())
    return inputStr

data = getInputStr()

a = str(data)
listStr = []
listStr = list(a)

# del listStr[len(listStr)-1]
listStr.reverse()

dp = [[0]*13 for _ in range(len(listStr)+1)]
dp[0][0] = 1

INF = 10 ** 9 + 7

for i in range(len(listStr)):
    if i ==0:
        keta = 1
    else:
        keta = pow(10, i)

    if listStr[i] == "?":
        for k in range(10):
            for j in range(13):
                dp[i+1][int(((k*keta)%13 + j) % 13)] += dp[i][j]
                # dp[i + 1][int(((k * ordinal) + j) % 13)] %= INF
    else:
        k = int(listStr[i])
        for j in range(13):
            dp[i + 1][int(((k*keta)%13 + j) % 13)] += dp[i][j]
            # dp[i + 1][int(((k*ordinal) + j) % 13)] %= INF


ans = dp[len(listStr)][5] % INF
print(ans)

### FIXED CODE ###

import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
nb = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    s = list(input())
    l = len(s)
    dp = [[0 for _ in range(13)] for __ in range(l + 1)]
    dp[0][0] = 1

    for i, si in enumerate(s):
        base = pow(10, l - i - 1, 13)

        if si == "?":
            for k in range(10):
                tmp = base * k % 13
                for j in range(13):
                    dp[i + 1][(j + tmp) % 13] += dp[i][j]
                    dp[i + 1][(j + tmp) % 13] %= MOD
        else:
            si = int(si)
            tmp = base * si % 13
            for j in range(13):
                dp[i + 1][(j + tmp) % 13] += dp[i][j]
                dp[i + 1][(j + tmp) % 13] %= MOD

    print(dp[l][5])


if __name__ == '__main__':
    main()
I = input
pr = print
# INF=1e9+7
def main():
	n = int(I())
	ar = list(map(int, I().split()))
	ar.append(0)
	dp = [0]*(n+1)
	# dp[n-1]=ar[-1]
	def solve(i):
		if i>=(n-1): return dp[i];
		if not dp[i]: dp[i] = min(abs(ar[i]-ar[i+1])+solve(i+1),abs(ar[i]-ar[i+2])+solve(i+2))
		return dp[i];
	pr(solve(0))

if __name__ == '__main__':main()

### FIXED CODE ###

import sys
I = lambda:map(int,sys.stdin.readline().split())
pr = lambda x:sys.stdout.write(f'{x}\n')
sys.setrecursionlimit(2000000001)

mn = lambda w,x,y,z: min(abs(w)+x,abs(y)+z)
n = ar = dp = 0

def solve(x):
	global n,ar,dp
	if x>=n-2: return dp[x]
	if dp[x] != -1: return dp[x]
	dp[x] = mn(ar[x]-ar[x+1], solve(x+1), ar[x]-ar[x+2], solve(x+2))
	# pr(f'{x} => {dp[x]}')
	return dp[x]

def main():
	global n,ar,dp
	n, ar = *I(), [*I()]
	dp = [-1]*(n-2) + [abs(ar[-2]-ar[-1]),0]
	# pr((n,ar,dp))
	pr(solve(0))

main()
import sys
input = sys.stdin.readline

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

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

uf = UnionFind(N)

for i in range(M):
    node1, node2 = map(int, input().split())
    uf.union(node1 - 1, node2 - 1)

cnt = 0
for i in range(N):
    if uf.same(i, P[i]):
        cnt += 1
print(cnt)


### FIXED CODE ###

import sys
input = sys.stdin.readline

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

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

uf = UnionFind(N)

for i in range(M):
    node1, node2 = map(int, input().split())
    uf.union(node1 - 1, node2 - 1)

cnt = 0
for i in range(N):
    if uf.same(i, P[i] - 1):
        cnt += 1
print(cnt)
h,w=map(int,input().split())
g=[list(input()) for _ in range(h)]
for x in range(h):
    for y in range(w):
        if g[y][x]=="#":
            k=0
            for i,j in [(1,0),(-1,0),(0,1),(0,-1)]:
                nx=x+i
                ny=y+j
                if nx<0 or nx>=h or ny<0 or ny>=w:#範囲外ならスルー
                    continue
                if g[ny][nx]==".":
                    k+=1
            if k==4:
                print("No")
                exit()
print("Yes")

### FIXED CODE ###

h,w=map(int,input().split())
g=[list(input()) for _ in range(h)]
for x in range(h):
    for y in range(w):
        if g[x][y]=="#":
            k=0
            for i,j in [(1,0),(-1,0),(0,1),(0,-1)]:
                nx=x+i
                ny=y+j
                if nx<0 or nx>=h or ny<0 or ny>=w:
                   continue
                if g[nx][ny]==".":
                    k+=1
            if k==4:
                print("No")
                exit()
print("Yes")
a = [int(input()) for _ in range(5)]
b = []
for i in range(len(a)):
    if a[i] % 10 == 0:
        b.append(0)
    else:
        b.append(10 - (a[i] % 10))
        c = b.index(max(b))

ans = 0
for i in range(5):
    if i !=c:
        if a[i] % 10 == 0:
            ans += a[i]
        else:
            ans += ((a[i] // 10) + 1) * 10
print(ans+a[c])



### FIXED CODE ###


from itertools import permutations

dishes = [int(input()) for _ in range(5)]

minT = 10000
for sample in permutations(dishes, 5):
    t = 0
    for dish in sample:
        if t%10 != 0:
            t += 10 - t%10
        t += dish
    minT = min(minT, t)
print(minT)
import math
A, B, H, M = map(float, input().split())

PI = math.pi
radA = (2.0 * PI * (H + M / 60.0)) / 12.0
radB = (2.0 * PI * M) / 60.0
print(math.hypot(A * math.cos(radA) - B * math.cos(radB), A * math.sin(radA) - B * math.sin(radB)))


### FIXED CODE ###

N = input()

last = list(N)[-1]
if int(last) in (2,4,5,7,9):
    print('hon')
elif int(last) in (0,1,6,8):
    print('pon')
else:
    print('bon')
import sys
def input():
    return sys.stdin.readline()[:-1]

"""
H Wの後に
#.#.
###.
みたいな文字列を受け取る
"""
H,W = map(int,input().split(' '))
MAP = [['#']*(W+1)] + [None]*H

for i in range(1,H+1):
    MAP[i] = ['#'] + list(map(str,input()))
import queue
q = queue.Queue()


MAP[H][W] = 'G'
visited = [None]*(H+1)
for i in range(H+1):
    visited[i] = [False]*(W+1)

d_num = 0
for i in range(1,H+1):
    for j in range(1,W+1):
        if MAP[i][j]=='#':
            d_num += 1

def is_okay(x,y):
    if not (0<x<W+1) or not (0<y<H+1):
        return False
    if visited[y][x] or MAP[y][x]=='#':
        return False
    return True

n = 0
q.put([1,1,n])
ans = 10**7 + 7

while not q.empty():
    x,y,n = q.get()
    k = MAP[y][x]

    n += 1
    if k=='G':
        ans = min(ans,n)
        break

    if is_okay(x+1,y): q.put([x+1,y,n]),visited[y][x+1] = True
    if is_okay(x-1,y): q.put([x-1,y,n]),visited[y][x-1] = True
    if is_okay(x,y+1): q.put([x,y+1,n]),visited[y+1][x] = True
    if is_okay(x,y-1): q.put([x,y-1,n]),visited[y-1][x] = True


if not ans==10**7 + 7:
    ANS = H*W - ans - d_num
else:
    ANS = -1

print(ANS)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]

"""
H Wの後に
#.#.
###.
みたいな文字列を受け取る
"""
H,W = map(int,input().split(' '))
MAP = [['#']*(W+1)] + [None]*H

for i in range(1,H+1):
    MAP[i] = ['#'] + list(map(str,input()))
import queue
q = queue.Queue()


MAP[H][W] = 'G'
visited = [None]*(H+1)
for i in range(H+1):
    visited[i] = [False]*(W+1)

d_num = 0
for i in range(1,H+1):
    for j in range(1,W+1):
        if MAP[i][j]=='#':
            d_num += 1

def is_okay(x,y):
    if not (0<x<W+1) or not (0<y<H+1):
        return False
    if visited[y][x] or MAP[y][x]=='#':
        return False
    return True

n = 0
q.put([1,1,n])
ans = 10**7 + 7

while not q.empty():
    x,y,n = q.get()
    k = MAP[y][x]

    n += 1
    if k=='G':
        ans = min(ans,n)
        break

    if is_okay(x+1,y):
        q.put([x+1,y,n])
        visited[y][x+1] = True
    if is_okay(x-1,y):
        q.put([x-1,y,n])
        visited[y][x-1] = True
    if is_okay(x,y+1):
        q.put([x,y+1,n])
        visited[y+1][x] = True
    if is_okay(x,y-1):
        q.put([x,y-1,n])
        visited[y-1][x] = True


if not ans==10**7 + 7:
    ANS = H*W - ans - d_num
else:
    ANS = -1

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

if a<=0 or 0<=b:
  print("Zero)
elif a<0:
  print("Positive" if abs(a-b)%2==1 else "Negative")
else:
  print("Positive")

### FIXED CODE ###

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

if a<=0 and 0<=b:
  print("Zero")
elif a<0:
  print("Positive" if abs(a-b)%2==1 else "Negative")
else:
  print("Positive")
from collections import deque

def solve(top, sa, sb, sc):
  if len(s[top]) == 0:
    return top
  top = s[top].popleft()
  return solve(top, sa, sb, sc)
  
s = {}
s['a'] = deque(input())
s['b'] = deque(input())
s['c'] = deque(input())

top = s['a'].popleft()
print(solve(top, sa, sb, sc))

### FIXED CODE ###

from collections import deque

def solve(top, sa, sb, sc):
  if len(s[top]) == 0:
    return top.upper()
  top = s[top].popleft()
  return solve(top, sa, sb, sc)
  
s = {}
s['a'] = deque(input())
s['b'] = deque(input())
s['c'] = deque(input())

top = s['a'].popleft()
print(solve(top, s['a'], s['b'], s['c']))
a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
f = a / b

print("{0} {1} {2:.5f}".format(d, r, f))

### FIXED CODE ###

a, b, c = [int(i) for i in input().split()]
count = 0
for x in range(a, b+1):
    if c % x == 0:
        count += 1
print(count)
import sys
from itertools import accumulate
from collections import Counter

input = sys.stdin.readline


def main():
    n = int(input())
    H = list(map(int, input().split()))
    print(
        Counter(accumulate([H[i] < H[i + 1] for i in range(n - 1)])).most_common(1)[0][
            1
        ]
        - 1
    )


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from itertools import accumulate
from collections import Counter

input = sys.stdin.readline


def main():
    n = int(input())
    H = list(map(int, input().split()))
    if n == 1:
        print(0)
        return
    # 連続した場合、同値
    acc = list(accumulate([H[i] < H[i + 1] for i in range(n - 1)]))
    x, y = Counter(acc).most_common(1)[0]
    print(y if x == 0 else y - 1)


if __name__ == "__main__":
    main()
n = int(input())

ans = 1000000000000

a = 1
while a * a <= n:
	if n % a != 0:
      continue
    b = n % a
    ans = min(ans, a + b - 2)
    a += 1

print(ans)

### FIXED CODE ###

n = int(input())

ans = 1000000000000

a = 1
while a * a <= n:
  if n % a != 0:
    a += 1
    continue
  b = n // a
  ans = min(ans, a + b - 2)
  a += 1

print(ans)
a = int(input)
b = int(input)
c = a * b
if c / 2 == c // 2:
  print(Even)
else:
  print(Odd)


### FIXED CODE ###

a = input().split()
b = int(a[1])
a = int(a[0])
if (a * b) % 2:
  print("Odd")
else:
  print("Even")
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
 
N,Q = map(int,readline().split())
abpx = list(map(int,read().split()))
ab = iter(abpx[:N+N-2])
px = iter(abpx[N+N-2:])
dic = {}
dic2=[0]*(N+1)
dic3=[0]*N

for i in range(N):
    dic[i+1] = []
for a,b in zip(ab,ab):
    dic[a].append(b)
    dic[b].append(a)
for p,x in zip(px,px):
    dic2[p] += x
def rec(now_node,prevval):
    nowval = prevval + dic2[now_node]
    dic3[now_node-1] = nowval
    tg_list = dic[now_node][:]
    for elem in tg_list:
        dic[elem].remove(now_node)
        rec(elem,nowval)
rec(1,0)
res = [str(dic3[i-1]) for i in range(1,N+1)]
print(' '.join(res))


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
N,Q = map(int,input().split())
ab = [ tuple(map(int,input().split())) for i in range(N-1) ]
px = [ tuple(map(int,input().split())) for i in range(Q) ]
dic = {}
dic2=[0]*(N+1)
dic3=[0]*N

for i in range(N):
    dic[i+1] = []
for i in range(N-1):
    tmp1 = ab[i][0]
    tmp2 = ab[i][1]
    dic[tmp1].append(tmp2)
    dic[tmp2].append(tmp1)
ab=0
for i in range(Q):
    dic2[px[i][0]] += px[i][1]
px=0
def rec(now_node,prevval):
    nowval = prevval + dic2[now_node]
    dic3[now_node-1] = nowval
    tg_list = dic[now_node][:]
    for elem in tg_list:
        dic[elem].remove(now_node)
        rec(elem,nowval)
rec(1,0)
res = [str(dic3[i-1]) for i in range(1,N+1)]
print(' '.join(res))
da = list(map(int,input().split()))

k = [[0 for i in range(2)]for j in range(10001)]
i = 0
su = 0
j = 0

while da[0] != 0 and da[1] != 0:
	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = list(map(int,input().split()))
		su += k[i][0] * k[i][1]


	sorted(k,key = lambda x: x[1],reverse = True)
	while da[1] > 0 and j != i + 1:
		if da[1] >= k[j][0] and j != i + 1
			su -= k[j][0] * k[j][1]
			da[1] -= k[j][0]
			j += 1
		else:
			su -= da[1] * k[j][1]
			da[1] = 0

	print(su)

	da = list(map(int,input().split()))
	if da[0] == 0 and da[1] == 0:
		break
	k = [[0 for i in range(2)]for j in range(10001)]



### FIXED CODE ###

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

k = [[0 for i in range(2)]for j in range(10001)]
i = 0
su = 0
j = 0

while da[0] + da[1] != 0:
	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = map(int,input().split())


	k = sorted(k,key = lambda x: x[1],reverse = True)

	while j != i + 1:
		if da[1] > k[j][0]:
			da[1] -= k[j][0]
			j += 1
		elif da[1] <= k[j][0] and da[1] > 0:
			su += (k[j][0] - da[1]) * k[j][1]
			da[1] = 0
			j += 1
		else:
			su += k[j][0] * k[j][1]
			j += 1

	print(su)

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

	k = [[0 for i in range(2)]for j in range(10001)]
import sys
input = sys.stdin.readline

W,H,x,y=map(int,input().split())
l=[0]
if H/W==y/x:
    l.append(H*W/2)
v=min(x*H,(W-x)*H)
l.append(v)
h=min(y*W,(H-y)*W)
l.append(h)
l.sort()
if l[-1]==l[-2]:
    print(l[-1],1)
else:
    print(l[-1],0)

### FIXED CODE ###

W,H,x,y=map(int,input().split())
print(W*H/2,1 if x==W/2 and y==H/2 else 0)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

a,b,c = map(int, raw_input().split())
if a <= c and b >= c:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

# -*- coding: utf-8 -*-

def Judge(a, b, c):
    if a > c:
        return 'No'
    elif c > b:
        return 'No'
    else:
        return 'Yes'

a,b,c = map(int, input().split())
print(Judge(a,b,c))
n = int(inut())
h = list(map(int, input().split()))
t = 0
for i in range(n - 2):
    if h[i] - h[i+1] >= 2:
        print("No")
        t = 1
        break
    elif i <= n - 4:
        if h[i] - h[i+1] == 1 and h[i+1] - h[i+2] == 1:
            print("No")
            t = 1
            break
if t == 0:
    print("Yes")


### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
t = 0
m = 0
for i in range(n):
    if h[i] > t:
        t = h[i]
    elif t - h[i] >= 2:
        print("No")
        m += 1
        break
if m == 0:
    print("Yes")
import numpy as np

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

# for i in range(0, n):
#     result = result * a[i]

result = np.prod(a)

if result > pow(10, 18):
    result = -1

print(a)
print(result)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1

for i in a:
    result = result * i

    # result = np.prod(a)

    if (result > pow(10, 18)):
        result = -1
        break

print(result)
=int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])

### FIXED CODE ###

A =int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])
N=int(input())
A=[int(_) for _ in input().split()]
ans=[0]*N
ans[0]=sum(A)//2-sum(A[1::2])
for i in range(N-１):
    ans[i+1]=A[i]-ans[i]
print(' '.join(str(2*a) for a in ans))

### FIXED CODE ###

N=int(input())
A=[int(_) for _ in input().split()]
ans=[0]*N
ans[0]=sum(A)//2-sum(A[1::2])
for i in range(N-1):
    ans[i+1]=A[i]-ans[i]
print(' '.join(str(2*a) for a in ans))
import math
def primecheck(x):
    primes =[]
    for i in range(2,math.ceil(x)):
        if x % i == 0:
            return False
            break 
    return True


x = int(input())
for i in range(x,10**5):
    if primecheck(i):
        break
print(i)




### FIXED CODE ###

import math
def primecheck(x):

    for i in range(2,math.ceil(x*(1/2))):
        if x % i == 0:
            return False
            break 
    return True



x = int(input())
for i in range(x,10**6):
    if primecheck(i):
        break
print(i)
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List:
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
            
            

### FIXED CODE ###

from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List.items():
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
n,m = map(int, input().split())
li = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    li[a].append(b)
    li[b].append(a)

nodes = [_ for _ in range(n)]
group = [1]*n

def dfs(node, group):
    s = li[node]
    group[node]=0
    for v in s:
        if group[v]!=0:
            dfs(v, group)

cnt = 0       
for i in range(n):
    if group[i]!=0:
        dfs(i,group)
        cnt += 1

print(cnt-1)


### FIXED CODE ###

from collections import deque
n,m = map(int, input().split())
G = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a-=1
    b-=1
    G[b].append(a)
    G[a].append(b)

dist = [-1]*n
que = deque()
cnt = 0

for i in range(n):
    if dist[i]!=-1:
        continue
    dist[i]=0
    que.append(i)
    while len(que):
        v = que.pop()
        s = G[v]
        for j in s:
            if dist[j]!=-1:
                continue
            dist[j]=0
            que.append(j)
    cnt += 1

print(cnt-1)
s = input()
n = len(s)
b = [s]

c = n-1
a = b[c]
if a == 2 or a == 4 or a == 5 or a == 7 or a == 9:
  print('hon')
elif a == 0 or a == 1 or a == 6 or a == 8:
  print('pon')
else:
  print('bon')


### FIXED CODE ###

s = input()
n = len(s)
a = s[n-1:n]
if a == '2' or a == '4' or a == '5' or a == '7' or a == '9':
  print('hon')
elif a == '0' or a == '1' or a == '6' or a == '8':
  print('pon')
else:
  print('bon')
n = int(input())
dat =list(input().split())

for i in dat:
	i = int(i)

dat.sort(reverse=True)

asum = 0
bsum = 0

for i in range(n):
     if i % 2 == 0:
         asum = asum + dat[i]
     else:
         bsum = bsum + dat[i]u
		
print(asum-bsum)

### FIXED CODE ###

n = int(input())
dat = list(input().split())

dat = list(map(int,dat))

dat.sort(reverse=True)

asum = 0
bsum = 0

for i in range(n):
	if i % 2 == 0:
		asum = asum + dat[i]
	else:
		bsum = bsum + dat[i]
		
print(asum-bsum)
a = int(input)
b = int(input)

A = [1, 2, 3]
A.pop(a-1)
A.pop(b-2)
print(A[0])

### FIXED CODE ###

a = int(input())
b = int(input())

A = [1, 2, 3]
A[a-1]= 0
A[b-1] = 0
print(sum(A))