Harryxun/stf_run huggingface dataset:
def distance(P, p1, p2):
    return min(abs(P[p1][1]-P[p2][1]), abs(P[p1][2]-P[p2][2]))
def root(CI, p):
    if CI[p] == p:
        return p
    else:
        CI[p] = root(CI, CI[p])
        return CI[p] 

N = int(input())
P = [[j]+[int(i) for i in input().split(' ')] for j in range(N)]
sortX = sorted(P,key=lambda x:x[1])
sortY = sorted(P,key=lambda x:x[2])
EX = [[sortX[i][0], sortX[i+1][0], distance(P,sortX[i][0],sortX[i+1][0])] for i in range(N-1)]
EY = [[sortY[i][0], sortY[i+1][0], distance(P,sortY[i][0],sortY[i+1][0])] for i in range(N-1)]
E = EX + EY
E = sorted(E, key=lambda x:x[2])
CI = [i for i in range(N)]
disSum = 0
for e in E:
    s,l = min(e[0],e[1]),max(e[0],e[1])
#     if CI[s] != CI[l]:
#         CI = list(map(lambda x:CI[s] if x == CI[l] else x, CI))
#         disSum += e[2]
    if root(CI, s) != root(CI, l):
        CI[root(CI, l)] = root(CI, s)
        disSum += e[2]
print(disSum)


### FIXED CODE ###


import sys
sys.setrecursionlimit(int(2e9))

def distance(P, p1, p2):
    return min(abs(P[p1][1]-P[p2][1]), abs(P[p1][2]-P[p2][2]))
def root(CI, p):
    if CI[p] == p:
        return p
    else:
        CI[p] = root(CI, CI[p])
        return CI[p] 

N = int(input())
P = [[j]+[int(i) for i in input().split(' ')] for j in range(N)]
sortX = sorted(P,key=lambda x:x[1])
sortY = sorted(P,key=lambda x:x[2])
EX = [[sortX[i][0], sortX[i+1][0], distance(P,sortX[i][0],sortX[i+1][0])] for i in range(N-1)]
EY = [[sortY[i][0], sortY[i+1][0], distance(P,sortY[i][0],sortY[i+1][0])] for i in range(N-1)]
E = EX + EY
E = sorted(E, key=lambda x:x[2])
CI = [i for i in range(N)]
disSum = 0
for e in E:
    s,l = min(e[0],e[1]),max(e[0],e[1])
#     if CI[s] != CI[l]:
#         CI = list(map(lambda x:CI[s] if x == CI[l] else x, CI))
#         disSum += e[2]
    if root(CI, s) != root(CI, l):
        CI[root(CI, l)] = root(CI, s)
        disSum += e[2]
print(disSum)
n, k = map(int, input().split())

if k == 0:
  print(n**2)
  exit()


ans = 0
for b in range(1, n+1):
  ans += (N//b) * max(0, b-k)
  ans += max(0, n%b+(1-k))
  
print(ans)


### FIXED CODE ###

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

if k == 0:
  print(n**2)
  exit()


ans = 0
for b in range(1, n+1):
  ans += n//b * max(0, b-k)
  ans += max(0, n%b+(1-k))
  
print(ans)
MOD = 10 ** 9 + 7
table_len = 10 ** 6 + 10

fac = [1, 1]
for i in range(2, table_len):
    fac.append(fac[-1] * i % MOD)
    
finv = [0] * table_len
finv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(table_len-1, 0, -1):
    finv[i-1] = finv[i] * i % MOD

def comb(a, b):
    return fac[a+b] * finv[a] * finv[b] % MOD


r1, c1, r2, c2 = map(int, input().split())
ans = (comb(r1, c1) + comb(r2+1, c2+1) - comb(r1, c2+1) - comb(r2+1, c1)) % MOD
print(ans)


### FIXED CODE ###

MOD = 10 ** 9 + 7
table_len = 2 * 10 ** 6 + 10

fac = [1, 1]
for i in range(2, table_len):
    fac.append(fac[-1] * i % MOD)
    
finv = [0] * table_len
finv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(table_len-1, 0, -1):
    finv[i-1] = finv[i] * i % MOD

def comb(a, b):
    return fac[a+b] * finv[a] * finv[b] % MOD


r1, c1, r2, c2 = map(int, input().split())
ans = (comb(r1, c1) + comb(r2+1, c2+1) - comb(r1, c2+1) - comb(r2+1, c1)) % MOD
print(ans)
N, K = map(int, input().split())
mod = 10 ** 9 + 7
for i in range(1, K+1):
    if i > N - K + 1
        print(0)
    else:
        ans = 1
        for j in range(K - i):
            ans = ans * (K - 1 - j )% mod
            ans = ans * pow(K - i - j, mod-2, mod) % mod
        for k in range(N - K - i + 1):
            ans = ans * (N - K + 1 - k) % mod
            ans = ans * pow(N - K - i + 1 - k, mod - 2, mod) % mod
        print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
mod = 10 ** 9 + 7
for i in range(1, K+1):
    if i > N - K + 1:
        print(0)
    else:
        ans = 1
        tmp = 1
        for j in range(K - i):
            ans = ans * (K - 1 - j )% mod
            tmp = tmp * (K - i - j) % mod
        for k in range(N - K - i + 1):
            ans = ans * (N - K + 1 - k) % mod
            tmp = tmp * (N - K - i + 1 - k) % mod
        ans = ans % mod * pow(tmp, mod - 2, mod) % mod
        print(ans)
import numpy as np

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

N = tmp[0]
M = tmp[1]

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

i = np.array(i)

i.reverse()

souwa = sum(i)

if i[M] < (souwa * (1/(4*M))):
    print("Yes")
else:
    print("No")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2



### FIXED CODE ###

import numpy as np

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

N = tmp[0]
M = tmp[1]

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

i = np.array(i)

i = np.sort(i)[::-1]

souwa = np.sum(i)

if i[M-1] < (souwa * (1/(4*M))):
    print("No")
else:
    print("Yes")
# print(i[0]) #出力：i_1
# print(i[1]) #出力：i_2
n = int(input())
a = sorted(list(map(int, input().split())))
m = int(input())
b = sorted(list(map(int, input().split())))
i = 0
for x in b:
    while i < n and a[i] < x:
        i += 1
    if i < n and a[i] == x:
        i += 1
    else:
        print('NO')
        exit(0)
print('YES')
satja@satja:~/k

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())))
m = int(input())
b = sorted(list(map(int, input().split())))
i = 0
for x in b:
    while i < n and a[i] < x:
        i += 1
    if i < n and a[i] == x:
        i += 1
    else:
        print('NO')
        exit(0)
print('YES')
# a, b, k = map(int, input().split())
s = input()

n = len(s)


def rep(str):
    ret = str.replace('01', '')
    ret = ret.replace('10', '')

    if ret != str:
        ret = rep(ret)

    return ret


input_str = s
# ret = None
#
# while ret is None or input_str != ret:
#     ret = input_str
#     input_str = rep(input_str)

ret = rep(s)

print(n - len(ret))


### FIXED CODE ###


s = input()

n = len(s)

cnt0 = s.count('0')
cnt1 = s.count('1')

print(min(cnt0, cnt1)*2)
n = int(input())

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

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(colors > 0 for color in colors)

print(ans, ans + over)



### FIXED CODE ###

n = int(input())

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

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(color > 0 for color in colors)

if ans:
    print(ans, ans + over)
else:
    print(1, over)
A,B,C=input().split()

A=B+D

E=C-D

print(E)

### FIXED CODE ###

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

if C-(A-B)>=0:
    print(C-(A-B))
else:
    print(0)
N = int(input())
nums = [int(input()) for i in range(N)]

print(max(nums) - min(nums))

### FIXED CODE ###

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

print(max(nums)-min(nums))
n=int(input())
n=input().split()
for i in range(len(n)):
   n[1]=int(n[i])
s=sum(n)
m=min(n)
ma=max(n)
print(m ma s)


### FIXED CODE ###

n=int(input())
r=input().split()
for i in range(len(r)):
    r[i]=int(r[i])
s=sum(r)
m=min(r)
ma=max(r)
print(m,ma,s)
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
i=0
p=0
while p<=x:
    p=p+l[i]
    i+=1
print(i)

### FIXED CODE ###

n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
i=0
p=0
while i<n:
    p=p+l[i]
    if p>x:
        break
    i+=1
print(i+1)
str_num = 1
a,b,c = 0, 0, 0
for i in s:
    if i == 'A':
        a += 1
    elif i == 'B':
        b += a
    elif i == 'C':
        c += b
    else:
        a,b,c = 3*a+str_num, a+3*b, b+3*c
        str_num *= 3
print(c)

### FIXED CODE ###

e,a,b,c=1,0,0,0
p=1000000007
for i in input():
  if i == "A":
    a+=e
  elif i == "B":
    b+=a
  elif i == "C":
    c+=b
  else:
    e,a,b,c = (3*e)%p,(e+3*a)%p,(a+3*b)%p,(b+3*c)%p
print(c%1000000007)
x=int(input())
y=int(input())


print(x+(y/2)):

### FIXED CODE ###

X,Y = map(int,input().split())
 
print( X + (Y // 2))
M,N=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()
#print(xdelta)

if xdelta == []:
	print(int(sum(map(abs,X))))
else:
	for i in range(M-1):
		xdelta.pop(-1)
	print(sum(xdelta))

### FIXED CODE ###

N,M=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()

if N < M:
	if N == 1:
		print(sum(xdelta))
	else:
		for i in range(N-1):
			xdelta.pop(-1)
		print(sum(xdelta))
else:
	print(0)
N = int(input())
A = [int(n) for n in input().split()]

def main():
    a = sorted(A)
    even = a[0] == 0
    aborted = False
    for i in range(N):
        correct = (i if even else i + 1) - (0 if i % 2 == 0 else 1)
        print(a[i], correct)
        if a[i] != correct:
            aborted = True
            break
    ans = 0 if aborted else int(2 ** ((N - (1 if even else 0)) / 2))
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

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

def main():
    d = {}
    for a in A:
        if a not in d:
            d[a] = 0
        d[a] += 1
    ks =  all(map(lambda k: k % 2 == 0, d.keys())) or all(map(lambda k: k % 2 != 0, d.keys()))
    if 0 in d:
        d[0] += 1
    vs = all(map(lambda v: v == 2, d.values()))

    if ks and vs:
        n = N if N % 2 == 0 else N - 1
        n //= 2
        ans = 1
        for _ in range(n):
            ans *= 2
            ans %= 1000000007
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()
N, As = int(input()), list(map(int, input().split()))
As = [As[i] - i - 1 for i in range(N)]
ans = sys.maxsize
for b in range(min(As), max(As) + 1):
    ans = min(ans, sum(map(lambda A: abs(A - b), As)))
print(ans)

### FIXED CODE ###

N, As = int(input()), map(int, input().split())
As = sorted([A - i - 1 for i, A in enumerate(As)])
b = As[N // 2]
print(sum(map(lambda A: abs(A - b), As)))
n = input()
digit = len(str(n))

count = 0
for i in range(digit - 1):
  if (i + 1) % 2 == 1:
    count += 10 ** (i + 1) - (10 ** i)

if digit % 2 == 1:
  count += n - 10 ** (digit - 1) + 1

print(count)

### FIXED CODE ###

n = int(input())
digit = len(str(n))

count = 0
for i in range(digit - 1):
  if (i + 1) % 2 == 1:
    count += 10 ** (i + 1) - (10 ** i)

if digit % 2 == 1:
  count += n - 10 ** (digit - 1) + 1

print(count)
n = int(input())
a = list(map(int, input().split()))
t = n * (n + 1) // 2
s = sum(a)
if s % t:
    print('NO')
else:
    c = s // t
    b = [0] * n
    for i in range(n):
        b[i] = a[i] - a[i - 1] - c
    for i in range(n):
        if b[i] % n or k < 0:
            print('NO')
            break
    else:
        print('YES')


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if (2 * s) % (n * (n + 1)) != 0:
    print('NO')
else:
    t = (2 * s) // (n * (n + 1))
    for i in range(n - 1):
        k = a[i - 1] - a[i] + t
        if k % n or k < 0:
            print('NO')
            break
    else:
        print('YES')
a,b=map(int,input().split())
list_=[]
for i in range(b):
  c=int(input())
  list_.append(c)
d=sum(list_)
print(a-d)

    


### FIXED CODE ###

a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sum(c)
ans=a-d
if ans>=0:
    print(ans)
else:
    print('-1')
from fractions import gcd

n, m = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]

a = set(a)
a = list(map(lambda x: x/2, a))
mp = a[0]
g= a[0]

for i in range(len(a)):
    g = gcd(g,a[i])
    mp = a[i] * mp

hlcm = int(mp/g)

ans = m // hlcm - (m // (hlcm*2))

print(ans)

### FIXED CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from fractions import gcd

    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    cnt = [0] * n

    for i, elem in enumerate(a):
        x = elem
        c = 0
        while x % 2 == 0:
            x //= 2
            c += 1
        cnt[i] = c

    ans = 0

    if len(set(cnt)) == 1:
        lcm = a[0]
        for elem in a[1:]:
            lcm = (lcm * elem) // gcd(lcm, elem)
        ans = (m + (lcm // 2)) // lcm

    print(ans)


if __name__ == '__main__':
    main()
a = int(input('<< '))
k=0
for i in range(1,a):
  if i%2 == 1:
    k += 1
  v = k/a
print(v)

### FIXED CODE ###

a = int(input())
if a%2 == 0:
  print(1/2)
else:
  print((a//2+1)/a)
n = input()
c = 0 
for _ in range(n):
  n,m = map(int,input().split())
  count += m-n+1
print(count)

### FIXED CODE ###

n = int(input())
c = 0 
for _ in range(n):
  n,m = map(int,input().split())
  c += m-n+1
print(c)
S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

answer = "UNRESTORABLE"
candidate = []

# まず T と一致させられる位置があるかを調べる
for i in range(len_S - len_T + 1):
  # print(S_dash[i:i+len_T])
  tmp = S_dash[i:i+len_T]
  
  count = 0
  for s, t in zip(tmp, T):
    if s == t or s == '?':
      count += 1
  if count == len_T:
    candidate.append(S_dash[:i] + T + S_dash[i+len_T:])
    
replaced_candidate = [item.replace("?", "a") for item in candidate]
replaced_candidate.sort()
print(replaced_candidate[0])

### FIXED CODE ###

S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

candidate = []

# まず T と一致させられる位置があるかを調べる
for i in range(len_S - len_T + 1):
  # print(S_dash[i:i+len_T])
  tmp = S_dash[i:i+len_T]
  
  count = 0
  for s, t in zip(tmp, T):
    if s == t or s == '?':
      count += 1
  if count == len_T:
    candidate.append(S_dash[:i] + T + S_dash[i+len_T:])
    
if candidate != []:       
  replaced_candidate = [item.replace("?", "a") for item in candidate]
  replaced_candidate.sort()
  print(replaced_candidate[0])
else:
  print("UNRESTORABLE")
bilding = [[[0 for i in range(10)] for j in range(3)]for k in range(4)]

n = int(input())
i = 0
while i < n:
    b, f, r, v = map(int, raw_input().split())
    bilding[r-1][f-1][b-1] += v
    i += 1

### FIXED CODE ###

bilding = [[[0 for x in range(10)] for x in range(3)]for x in range(4)] 
n = int(input())
for k in range(n):
    b, f, r, v = map(int, raw_input().split())
    bilding[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        print(" "+" ".join(map(str, bilding[b][f])))
    if b != 3:
        print("#"*20)
from collections import Counter
n = int(input())
arr = list(map(int, input().split()))

odd_list =[]
num_list =[]

for i in range(n):
    if i%2 == 0:
        odd_list.append(arr[i])
    if i%2 != 0:
        num_list.append(arr[i])

odd_count = Counter(odd_list)
num_count = Counter(num_list)
odd1 = odd_count[odd_count.most_common()[0][0]]
num1 = num_count[num_count.most_common()[0][0]]

if n == 2 and arr[0] != arr[1]:
    print(0)
    exit()

if n == 2 and arr[0] == arr[1]:
    print(1)
    exit()

if len(set(arr)) == 1:
    print(int(n/2))
    exit()

if len(set(odd_count)) == 1 and len(set(num_count)) != 1:
    num2 = num_count[num_count.most_common()[1][0]]
    if odd_list[0] == num_count.most_common()[0][0]:
        print(int(n/2)-num2)
        exit()
    if odd_list[0] != num_count.most_common()[0][0]:
        print(int(n/2)-num1)
        exit()

if len(set(odd_count)) != 1 and len(set(num_count)) == 1:
    odd2 = odd_list[odd_count.most_common()[1][0]]
    if num_list[0] == odd_count.most_common()[0][0]:
        print(int(n/2)-odd2)
        exit()
    if num_list[0] != odd_count.most_common()[0][0]:
        print(int(n/2)-odd1)
        exit()

odd2 = odd_count[odd_count.most_common()[1][0]]
num2 = num_count[num_count.most_common()[1][0]]

if odd_count.most_common()[0][0] != num_count.most_common()[0][0]:
    print(n-odd1-num1)

if odd_count.most_common()[0][0] == num_count.most_common()[0][0]:
    print(min(n-odd1-num2, n-odd2-num1))

### FIXED CODE ###

from collections import Counter
n = int(input())
arr = list(map(int, input().split()))

odd_list =[]
num_list =[]

for i in range(n):
    if i%2 == 0:
        odd_list.append(arr[i])
    if i%2 != 0:
        num_list.append(arr[i])

odd_count = Counter(odd_list)
num_count = Counter(num_list)
odd1 = odd_count[odd_count.most_common()[0][0]]
num1 = num_count[num_count.most_common()[0][0]]

if odd1 != num1:
    print(n-odd_count.most_common()[0][1]-num_count.most_common()[0][1])
    exit()

if len(set(arr)) == 1:
    print(int(n/2))
    exit()

if len(set(num_list))==1 and len(set(odd_list))==1:
    print(0)
    exit()

if len(set(odd_count)) == 1 and len(set(num_count)) != 1:
    num2 = num_count[num_count.most_common()[1][0]]
    if odd_list[0] == num_count.most_common()[0][0]:
        print(int(n/2)-num2)
        exit()
    if odd_list[0] != num_count.most_common()[0][0]:
        print(int(n/2)-num1)
        exit()

if len(set(odd_count)) != 1 and len(set(num_count)) == 1:
    odd2 = odd_list[odd_count.most_common()[1][0]]
    if num_list[0] == odd_count.most_common()[0][0]:
        print(int(n/2)-odd2)
        exit()
    if num_list[0] != odd_count.most_common()[0][0]:
        print(int(n/2)-odd1)
        exit()

odd2 = odd_count[odd_count.most_common()[1][0]]
num2 = num_count[num_count.most_common()[1][0]]

if odd_count.most_common()[0][0] != num_count.most_common()[0][0]:
    print(n-odd1-num1)

if odd_count.most_common()[0][0] == num_count.most_common()[0][0]:
    print(min(n-odd1-num2, n-odd2-num1))
n = int(input())
a = [int(i) for i in input().split()]

ans = 0
for i in range(n-1):
  if a[i] > i[i+1]:
    x += (a[i] - a[i+1])
    a[i+1] = a[i]

print(ans)

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N-1):
    if A[i]>A[i+1]:
        ans += A[i]-A[i+1]
        A[i+1] = A[i]
print(ans)
import math

n = int(input())

print(2*n//math.gcd(2,n)) #最小公倍数

### FIXED CODE ###

import math

n = int(input())
asn = 0

if n % 2 == 0: ans = n
else: ans = 2*n

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

if A + B + C >= 22:
    print('bust')
else:
    print('win')

### FIXED CODE ###

 
A, B, C = map(int, input().split())
val = A + B + C
if val >= 22:
    print('bust')
else:
    print('win')
n, k = map(int, input().split())

li = [0]
li.extend(list(map(int, input().split())))
tuita = [0]*(n+1)
cnt = 0
town = 1

def search(town, times):
  global li
  if times <= 0:
    return town
  else:
    return search(li[town], times-1)

while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      print(search(1, k))
    elif k == tuita[town]:
      print(town)
    else:
      print(search(town, (k - tuita[town]) % (cnt - tuita[town])))
    break
 

  
    

### FIXED CODE ###

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

li = [0]
li.extend(list(map(int, input().split())))
tuita = [0]*(n+1)
cnt = 0
town = 1

lastTown = 1
while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      lastTown = 1
      times = k
    elif k == tuita[town]:
      lastTown = town
      times = 0
    else:
      lastTown = town
      times = (k - tuita[town]) % (cnt - tuita[town])
    break

town = lastTown
while times > 0:
  if times <= 0:
    break
  times -= 1
  town = li[town]
print(town)
N,M-map(int,input().split())
hoge=list(ap,int,input.split())
total_vote=sum(hoge)
if sorted(hoge)[-M]>total_vote/(4*M):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

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

if sorted(hoge)[-M] >= sum(hoge)/(4*M):
  print('Yes')
else:
  print('No')
list = map(int,input().split())
W = list(0) 
H = list(1) 
x = list(2)
y = list(3)
r = list(4)

if x-r < 0:
    print "No"
elif x + r > W:
    print "No"
elif y-r < 0:
    print "No"
elif y+r > H:
    print "No"
else:
    print "Yes"

### FIXED CODE ###

W,H,x,y,r = map(int,input().split(" "))
if x - r >= 0 and x + r <= W:
    if y - r >= 0 and y + r <= H:
        print("Yes")
    else:
        print("No")
else:
    print("No")
n = int(input())

ans = 0

for i in range(6,,-1):
  if n >= 2**i:
    ans = 2**i
    break
print(ans)

### FIXED CODE ###

n = int(input())

ans = 1

for i in range(6,0,-1):
  if n >= 2**i:
    ans = 2**i
    break
print(ans)
payment = input()
price = float(payment) / 1.08


if (price - int(price)) == 0:
  print(int(price))
else:
  print(':(')


### FIXED CODE ###

targetDay = input().split()
nextDay	  = input().split()

if targetDay[0] != nextDay[0]:
	print(1)
else:
    print(0)
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
minutes = 0

if sum(a) + sum(b) <= k:
  ans = len(a) + len(b)
  print(ans)
else:
  while minutes <= k:
    if a[0] and b[0]:
      if a[0] <= b[0]:
        minutes += a[0]
        a.pop(0)
      else:
        minutes += b[0]
        b.pop(0)
    elif a[0]:
      minutes += a[0]
      a.pop(0)
    elif b[0]:
      minutes += b[0]
      b.pop(0)
  ans = n + m - len(a) - len(b)
  if minutes > k:
    ans -= 1
  print(ans)

### FIXED CODE ###

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

a_sum = [0]
for i in range(n):
  a_sum.append(a[i] + a_sum[i])
b_sum = [0]
for i in range(m):
  b_sum.append(b[i] + b_sum[i])
  
ans = 0
j = m
for i in range(n+1):
  if a_sum[i] > k:
    break
  while a_sum[i] + b_sum[j] > k:
    j -= 1
  ans = max(ans, i + j)
print(ans)
import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7

if N==K:
  ans0 = 1
  for a in A[0:N]:
    ans0 *= a
    ans0 %= MOD
  print(ans0)
  exit()
A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 *= a
    ans1 %= MOD
  print(ans1)
  exit()

A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]

ansA = 1
for a in A[0:K]:
  ansA *= a
  ansA %= MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

while ansA>0:
  ansA-=MOD
B1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]
if not Bp:Bp=[1]
if not Bm:Bm=[1]
  
B1.remove(Bp[-1])
B1.append(B2[0])

ansB = 1
for a in B1[0:K]:
  ansB *= a
  ansB %= MOD

C1=A[0:K]
C1.remove(Bm[-1])
C1.append(B2[-1])

ansC = 1
for a in C1[0:K]:
  ansC *= a
  ansC %= MOD
  
print(max(ansB,ansC)%MOD)

### FIXED CODE ###

import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7
if N==K:
  ans0 = 1
  for a in A[0:N]:
    ans0 *= a
    ans0 %= MOD
  print(ans0)
  exit()
A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 *= a
    ans1 %= MOD
  print(ans1)
  exit()
 
A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]
 
ansA = 1
for a in A[0:K]:
  ansA *= a
  ansA %= MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

while ansA>0:
  ansA-=MOD

B1=A[0:K]
C1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]
 
if B2[0]>0:B2.insert(0,0)
if B2[-1]<0:B2.insert(-1,0)
if not Bp:Bp.insert(0,B1[-1])
if not Bm:Bm.insert(0,B1[0])
  
#print(Bp,Bm,B2)
#print(Bp[-1],B2[0])
B1.remove(Bp[-1])
B1.append(min(B2[0],0))
#print(B1)
ansB = 1
for a in B1[0:K]:
  ansB *= a
  ansB %= MOD
#print(Bm[-1],B2[-1])
C1.remove(Bm[-1])
C1.append(max(B2[-1],0))
 
ansC = 1
for a in C1[0:K]:
  ansC *= a
  ansC %= MOD
#print(B1,C1)
#print(ansB,ansC)
BB1=[np.sign(i) for i in B1]
ansBB1 = BB1[0:K].count(-1)%2
BB2=[np.sign(i) for i in C1]
ansBB2 = BB2[0:K].count(-1)%2
#print(ansBB1,ansBB2)
if ansBB1==1:
  print(ansC)
  exit()
if ansBB2==1:
  print(ansB)
  exit()
#print(B2[0]/Bp[-1],B2[-1]/Bm[-1])
#print(Bp[-1]*B2[-1],Bm[0]*B2[0])

#print(abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0]))
#print(ansB,ansC)
if abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0])>=0:
  print(ansC)
else: print(ansB)
n = int(input()) 
for i in range(n):
   p = list(map(int,input().split()))
   p.sort()
   if p[0]*p[0] + p[1]*p[1] == p[2]*p[2]:
     print("YES")
   else
     print("NO")


### FIXED CODE ###

n=int(input())
for i in range(n):
    a,b,c = input().split()
    x = int(a)
    y = int(b)
    z = int(c)
    p = [x,y,z]
    p.sort()
    if pow(p[0],2) + pow(p[1],2) == pow(p[2],2):
        print('YES')
    else:
        print('NO')
A,B = (int(i) for i in input().split())  
if len(A)>1 or len(B)>1:
  print("-1")
else:
  print(A*B)

### FIXED CODE ###

A,B = (int(i) for i in input().split())  
if (A>9) or (B>9):
    print("-1")
else:
    print(A*B)