Harryxun/stf_run huggingface dataset:
if __name__ == '__main__':
    n, m, x = list(map(int, input().split()))
    
    c = []
    a = []
    
    def calc_price(bit):
        price_total = 0
        learn_total = [0] * m #理解度
        
        for i in range(n):
            if (bit >> i) & 1:
                price_total += c[i]
                learn = a[i]
                for j, la in enumerate(learn):
                    learn_total[j] += la
        
        if check(learn_total):
            return price_total
        else:
            return INF
        
    def check(learn_total):
        for i in range(m):
            if learn_total[i] < x:
                return False
        return True
    
    for i in range(n):
        c_temp, *a_temp = list(map(int, input().split()))
        c.append(c_temp)
        a.append(a_temp)
        
    INF = float("inf")
    ans = INF
    
    for bit in range(1 << n):
        price = calc_price(bit)
        ans = min(ans, price)
    
    if ans == INF:
        print(-1)
    else:
        print(ans)

### FIXED CODE ###

def Registration():
    S = input()
    T = input()
    
    flag = False
    if len(S) + 1 == len(T):
        if S == T[:-1]:
            flag = True
    
    if flag:
        print('Yes')
    else:
        print('No')

Registration()
N,M,V,P = map(int,input().split())
import numpy as np
A = list(map(int,input().split()))
A = np.array(sorted(A,reverse=True))
ans = P
x = A[P-1]
for i in range(P,N):
  a = A[i]
  if x==a:
    ans+=1
  else:
    y=i
    break
    
for i in range(y,N):
  d = A[i]+M
  if x<=d:
    b = N-i+P-1
    c = M*(V-b)
    for j in range(i-1,P-2,-1):
      e = d-A[j]
      c-=(max(0,e))
      if c <=0:
        ans+=1
        break
      elif e<=0:
        break
        
print(ans)

### FIXED CODE ###

N,M,V,P = map(int,input().split())
import numpy as np
A = list(map(int,input().split()))
A = np.array(sorted(A,reverse=True))
ans = P
x = A[P-1]
y=P
z = sum(A[P-1:y])
for i in range(y,N):
  a = A[i]
  d = a+M
  if x<=d:
    b = N-i+P-1
    c = M*(V-b)
    e = z+c
    f = d*(i-P+1)
    if f>=e:
      ans+=1
      
  z+=a
print(ans)
import sys
from collections import deque

import numpy as np

sys.setrecursionlimit(100000000)


def solve(n, arr, q, path, c):
  flag = True
  for i in path:
    if path[i] == 0:
      flag = False
  if flag:
    return path
  if c > 100000000:
    return -1
  if len(q) == 0:
    return -1
  pos = q.popleft()
  for i in range(1, n):
    if arr[pos][i] == 1:
      q.append(i)
      if path[i+1] == 0:
        path[i+1] = pos+1
  return solve(n, arr, q, path, c+1)
        

def calc(n, arr):
  path = {i:0 for i in range(2, n+1)}
  queue = deque()
  for i in range(n):
    if arr[0][i] == 1:
      queue.append(i)
      path[i+1] = 1
  result = solve(n, arr, queue, path, 0)
  if result == -1:
    return ["No"]
  else:
    L = ["Yes"]
    for i in result:
      L.append(result[i])
    return L

n, m = map(int, input().split())
arr = np.zeros([n, n])
for i in range(m):
  tmp0, tmp1 = map(int, input().split())
  arr[tmp0-1][tmp1-1] = 1
  arr[tmp1-1][tmp0-1] = 1

answer = calc(n, arr)
for i in answer:
  print(i)



### FIXED CODE ###

from collections import deque

def main():
    n,m = map(int,input().split())
    ab = [[] for i in range(n)]
    for _ in range(m):
        a,b = map(int,input().split())
        ab[a-1].append(b-1)
        ab[b-1].append(a-1)
    q = deque()
    q.append(0)
    ans = [-1] * n
    ans[0] = 0
    while q:
        now = q.popleft()
        for i, next in enumerate(ab[now]):
            if ans[next] == -1:
                ans[next] = now+1
                q.append(next)
        if len(q) == 0:
            break
    print('Yes')
    for i in range(1,n):
        print(ans[i])



if __name__=='__main__':
    main()
s,d=input(),"abcdefghijklmnopqrstuvwxyz"
for i in range(27):
  if not d[i]in s:
    print(d[i])
    exit()
print("None")

### FIXED CODE ###

s,d=input(),"abcdefghijklmnopqrstuvwxyz"
for i in range(26):
  if not d[i]in s:
    print(d[i])
    exit()
print("None")
#???????????´??° x ?????????????????§???x ?????????????¨????????????????????????????????????°?????????????????????????????????
x = raw_input()
print(int(x)**3)

### FIXED CODE ###


x = raw_input()
print(int(x)**3)
[A,V]=[int(i) for i in input.split()]
[B,W]=[int(i) for i in input.split()]
T=int(input())
if max(A-B,B-A)>T*max(V-W,W-V):print("NO")
else:print("YES")

### FIXED CODE ###

[A,V]=[int(i) for i in input().split()]
[B,W]=[int(i) for i in input().split()]
T=int(input())
if W-V>0 or abs(B-A)>T*abs(W-V):print("NO")
else:print("YES")
a = int(input())
ar = list(map(int,input().split()))
if 0 in ar:
    print(0)
    exit()
b = 1
for r in ar:
    b *= r
    if b > 10 ** 18:
        print(-1)
        return
print(b)


### FIXED CODE ###

a = int(input())
ar = list(map(int,input().split(" ")))
if 0 in ar:
    print(0)
    exit()
b = 1
for r in ar:
    b *= r
    if b > 10 ** 18:
        print(-1)
        exit()
print(b)
import bisect

N = int(input())
As = sorted(list(map(int, input().split())))
Bs = sorted(list(map(int, input().split())))
Cs = sorted(list(map(int, input().split())))

# BとCのセットだけ見てありえるパターンを出す
B_Cs = [0] * N
for i, b in enumerate(Bs):
    index = bisect.bisect_left(Cs, b+1)
    B_Cs[i] = (N - index)

cumsum_BC =[sum(B_Cs[i:]) for i in range(N)]

cnt = 0
for i, a in enumerate(As):
    index = bisect.bisect_left(Bs, a+1)
    cnt += cumsum_BC[index]
print(cnt)

### FIXED CODE ###

import bisect

N = int(input())
As = sorted(list(map(int, input().split())))
Bs = sorted(list(map(int, input().split())))
Cs = sorted(list(map(int, input().split())))

cnt = 0
for b in Bs:
    a_b = bisect.bisect_left(As,b)
    b_c = N - bisect.bisect_right(Cs, b)
    
    cnt += a_b * b_c
print(cnt)
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
  return True
if i >= n or m > sum(A):
  return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M:
  if solve(0,m):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

for m in M:
  if solve(0,m):
     print "yes"
  else:
     print "no"
s = input()
N = len(s)
D = {}
for i in range(N):
    if s[i] in D:
        D[s[i]] += 1
    else:
        D[s[i]] = 1
my_p = N//2
score = my_p - D["p"]
print(score)

### FIXED CODE ###

s = input()
N = len(s)
D = {"g":0, "p":0}
for i in range(N):
    D[s[i]] += 1
my_p = N//2
score = my_p - D["p"]
print(score)
from math import *

x1, y1, x2, y2 = map(int, raw_input().split())
distance = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))
print distance

### FIXED CODE ###

from math import *

x1, y1, x2, y2 = map(float, raw_input().split())
distance = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))
print distance
ls = []
while True:
    try:
        data = float(raw_input().split())
        ls.append(data)
    except EOFError:
        break
ls.sort()
ans = ls[-1]-ls[0]
print ans

### FIXED CODE ###

ls = []
while True:
    try:
        data = float(raw_input())
        ls.append(data)
    except EOFError:
        break
        
print max(ls)-min(ls)
n,k = map(int, input().split())
a =list(map(int, input().split()))
ans =1

if n == k:
   for i in a:
       ans *= i
       if abs(ans) >10**9+7:
           ans = ans%(10**9+7)
elif all(i <= 0 for i in a) and k%2 ==1:
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        if abs(ans) > 10 ** 9 + 7:
            ans = ans % (10 ** 9 + 7)
else:
    am =[]
    ap =[]

    a.sort(key = abs,reverse = True)
    amax = a[:k]
    amin = a[k:]
    c=1
    for i in amax:
        if i<0:
            am.append(i)
            c *=-1
        else:
            ap.append(i)
    if c ==1:
        for i in amax:
            ans *= i
            if abs(ans) > 10 ** 9 + 7:
                ans = ans % (10 ** 9 + 7)
    else:
        print(ap,am,amin)
        if min(amin)/min(ap) > max(amin)/max(am):
            amax.remove(max(am))
            amax.append(max(amin))
        else:
            amax.remove(min(ap))
            amax.append(min(amin))
        for i in amax:
            ans *= i
            if abs(ans) > 10 ** 9 + 7:
                ans = ans % (10 ** 9 + 7)

print(ans% (10 ** 9 + 7))


### FIXED CODE ###

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

if n == k:
   for i in a:
       ans *= i
       if abs(ans) >10**9+7:
           ans = ans%(10**9+7)

elif all(i <= 0 for i in a) and k%2 ==1:
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        if abs(ans) > 10 ** 9 + 7:
            ans = ans % (10 ** 9 + 7)

else:
    am =[]
    ap =[]

    a.sort(key = abs,reverse = True)
    amax = a[:k]
    amin = a[k:]
    c=1
    if 0 in amax:
        ans = 0
    else:
        for i in amax:
            if i<0:
                am.append(i)
                c *=-1
            elif i>0:
                ap.append(i)
        if c ==1:
            for i in amax:
                ans *= i
                if abs(ans) > 10 ** 9 + 7:
                    ans = ans % (10 ** 9 + 7)
        else:
            if ap == []:
                amax.remove(max(am))
                amax.append(max(amin))

            elif max(am)*min(amin) < min(ap)*max(amin):
                amax.remove(max(am))
                amax.append(max(amin))
            else:
                amax.remove(min(ap))
                amax.append(min(amin))
            for i in amax:
                ans *= i
                if abs(ans) > 10 ** 9 + 7:
                    ans = ans % (10 ** 9 + 7)

print(ans % (10 ** 9 + 7))
import sys
S = list(input())
x, y = map(int, input().split())
c = 0
p = 0
q = 0
now = 0
R = []
L = []
for i in range(len(S)):
    if S[i] == "T":
        if p != 0:
            R.append(p)
            p = 0
        elif q != 0:
            L.append(q)
            q = 0
        c += 1
    elif c == 0:
        now += 1
    elif c % 2 == 0:
        p += 1
    else:
        q += 1
if p != 0:
    R.append(p)
if q != 0:
    L.append(q)

A = 2*(sum(R)+now)
B = 2*(sum(L))
dp_x = [[0]*(A+2) for _ in range(len(R)+2)]
dp_y = [[0]*(B+2) for _ in range(len(L)+1)]
c = 0
dp_x[0][sum(R)+now] = 1
dp_y[0][sum(L)] = 1
for i in range(1, len(R)+2):
    for j in range(A+2):
        if i == 1:
            if j - now >= 0:
                if dp_x[i-1][j-now] == 1:
                    dp_x[i][j] = 1
        else:
            if j - R[i-2] >= 0:
                if dp_x[i-1][j-R[i-2]] == 1:
                    dp_x[i][j] = 1
            if j + R[i-2] <= A+1:
                if dp_x[i-1][j+R[i-2]] == 1:
                    dp_x[i][j] = 1

for i in range(1, len(L)+1):
    for j in range(B+2):
        if j - L[i-1] >= 0:
            if dp_y[i-1][j-L[i-1]] == 1:
                dp_y[i][j] = 1
        if j + L[i-1] <= B+1:
            if dp_y[i-1][j+L[i-1]] == 1:
                dp_y[i][j] = 1

if A + 2 < x+sum(R)+now or x+sum(R)+now < 0:
    print("No")
    sys.exit()

if B + 2 < y+sum(L) or y+sum(L) < 0:
    print("No")
    sys.exit()

if dp_x[len(R)+1][x+sum(R)+now] == 1 and dp_y[len(L)][y+sum(L)] == 1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
S = list(input())
x, y = map(int, input().split())
c = 0
p = 0
q = 0
now = 0
R = []
L = []
for i in range(len(S)):
    if S[i] == "T":
        if p != 0:
            R.append(p)
            p = 0
        elif q != 0:
            L.append(q)
            q = 0
        c += 1
    elif c == 0:
        now += 1
    elif c % 2 == 0:
        p += 1
    else:
        q += 1
if p != 0:
    R.append(p)
if q != 0:
    L.append(q)

A = 2*(sum(R)+now)
B = 2*(sum(L))
dp_x = [[0]*(A+2) for _ in range(len(R)+2)]
dp_y = [[0]*(B+2) for _ in range(len(L)+1)]
c = 0
dp_x[0][sum(R)+now] = 1
dp_y[0][sum(L)] = 1
for i in range(1, len(R)+2):
    for j in range(A+2):
        if i == 1:
            if j - now >= 0:
                if dp_x[i-1][j-now] == 1:
                    dp_x[i][j] = 1
        else:
            if j - R[i-2] >= 0:
                if dp_x[i-1][j-R[i-2]] == 1:
                    dp_x[i][j] = 1
            if j + R[i-2] <= A+1:
                if dp_x[i-1][j+R[i-2]] == 1:
                    dp_x[i][j] = 1

for i in range(1, len(L)+1):
    for j in range(B+2):
        if j - L[i-1] >= 0:
            if dp_y[i-1][j-L[i-1]] == 1:
                dp_y[i][j] = 1
        if j + L[i-1] <= B+1:
            if dp_y[i-1][j+L[i-1]] == 1:
                dp_y[i][j] = 1

if A + 1 < x+sum(R)+now or x+sum(R)+now < 0:
    print("No")
    sys.exit()

if B + 1 < y+sum(L) or y+sum(L) < 0:
    print("No")
    sys.exit()

if dp_x[len(R)+1][x+sum(R)+now] == 1 and dp_y[len(L)][y+sum(L)] == 1:
    print("Yes")
else:
    print("No")
N=int(input())
inp=list(map(int,input().split(' ')))
su=sum(inp)
ab=su
for i in range(N):
  s1=0
  for j in range(i):
    s1+=inp[j]
  if (ab>abs(2*s1-su)):
    ab=abs(2*s1-su)
print(ab)

### FIXED CODE ###

inp=list(map(int,input().split(' ')))
print(min(inp)+sorted(inp)[1])
## 21
import sympy
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(sympy.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    x +=1
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break


### FIXED CODE ###

# 21   import sympyが最速だが、Atcoderには無い
import math
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break
    x+=1
s=input()

n=len(s)
h=(n-1)//2
hh=h//2
h3=(n+3)//2
h3h=(h3+n)//2

s1=s[:h]
s2=s[h+1:]
s3=s[:hh]
s4=s[hh+1:h]
s5=s[h3-1:h3h-1]
s6=s[h3h:]

f1=f2=f3=True
for i in range(len(s1)):
  if s1[i]!=s2[len(s2)-1-i]:
    f1=False
for i in range(len(s3)):
  if s3[i]!=s4[len(s4)-1-i]:
    f2=False
for i in range(len(s5)):
  if s5[i]!=s6[len(s6)-1-i]:
    f3=False

ans='Yes' if f1==f2==f3==True else 'No'
print(ans)

### FIXED CODE ###

def main():
    I=lambda:input()
    s=I()
    if s!=s[::-1]:
        print('No')
        exit()
    s1=s[:(len(s)-1//2)+1]
    if s1!=s1[::-1]:
        print('No')
        exit()
    s2=s[(len(s)+3)//2-1:]
    if s2!=s2[::-1]:
        print('No')
        exit()
    print('Yes')
    
if __name__ == '__main__':
    main()
amount = int(input())

coins = [x for x in range(3,amount+1)]

lst = [amount+1 for x in range(amount+1)]

lst[0] = 1
lst[1] = 0
lst[2] = 0
lst[3] = 1
lst[4] = 1
lst[5] = 1


for i in range(6,amount+1):
    counter = 0
    for coin in coins:
        change = i - coin

        if change >= 0:
            counter += lst[change]
    lst[i] = counter

print(lst[-1] % (10**9 + 7))




### FIXED CODE ###

import sys
amount = int(input())

lst1 = [3,4,5]
if amount in lst1:
    print(1)
    sys.exit()
elif amount < 6:
    print(0)
    sys.exit()

coins = [x for x in range(3,amount+1)]

lst = [amount+1 for x in range(amount+1)]

lst[0] = 1
lst[1] = 0
lst[2] = 0
lst[3] = 1
lst[4] = 1
lst[5] = 1


for i in range(6,amount+1):
    counter = 0
    for coin in coins:
        change = i - coin

        if change >= 0:
            counter += lst[change]
    lst[i] = counter

print(lst[-1] % (10**9 + 7))
import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    st=[tx-sx,ty-sy]; rst=R(st)
    F=[rwt<r,rsw<r]
    if rst==0: c=1
    elif F==[1,1]: c=1 # 両方壁の中
    elif F==[1,0] or F==[0,1]: c=0 # 片方が壁の中
    elif F==[0,0]: #両方壁の外
      a=M.pi/2-M.acos(r/rsw)
      tmp=(sw[0]*st[0]+sw[1]*st[1])/rsw/rst
      if abs(abs(tmp)-1)<1e-6: tmp=1
      b=M.acos(tmp/2)
      if C(a,b) and C(rst**2,rsw**2-r**2): c=0
      else: c=1
    x.append(c)
  return all(x)

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]

### FIXED CODE ###

import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  st=[tx-sx,ty-sy]; rst=R(st)
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    F=[rwt<r,rsw<r]
    if F==[1,0] or F==[0,1]: return 0
    elif F==[0,0]:
      a=M.pi/2-M.acos(r/rsw)
      b=M.acos(round((sw[0]*st[0]+sw[1]*st[1])/rsw/rst,4))
      if C(a,b) and C(rst**2,rsw**2-r**2): return 0
  return 1

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]
def change(money):
  a  = money % 1000
  if a != 0:
    change = 1000 - a
    return change
  elif a = 0:
    change = 0
    return change
    
  

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Jul  5 20:25:04 2020

@author: KevinLU
"""
money = int(input())

a  = money % 1000
if a > 0:
    change = 1000 - a
else:
    change = 0
print(change)
N = int(input())

def f(n):
    if n < 2:
        return 1
    if n >= 2:
        return n*f(n-2)

@memoize
def memf(n):
    if ( n<=1 ):
        return 1
    else:
        return n*f(n-2)
        
ans = memf(N)
# print(ans)
str_ans = str(ans)
count = 0
for s in reversed(str_ans):
    if s != '0':
        break
    count += 1
print(count)

### FIXED CODE ###

N = int(input())

def factorial(n, p):
    if n == 0: return 0
    return n//p + factorial(n//p, p)

def duble_factorial(n, p):
    if n%2 == 1:
        return factorial(n,p) - duble_factorial(n-1, p) # n!! = n!/(n-1)!!だからpで割ると引き算で表せるよね
    else:
        res = factorial(n//2, p)
        if p == 2: 
            res += n//2
        return res

ans = min(duble_factorial(N,2), duble_factorial(N,5))
print(ans)
k = int(input())
x, y = map(int, input().split())

if k % 2 == 0 and (x + y) % 2 == 1:
    print(-1)
    exit()

a = 1
b = 1
d = 0
if x < 0:
    x *= -1
    a = -1
if y < 0:
    y *= -1
    b = -1
if x < y:
    d = 1
    x, y = y, x

def show_xy(tx, ty):
    if d == 1:
        print(ty * a, tx * b)
    else:
        print(tx * a, ty * b)

if x + y < k and (x + y) % 2 == 1:
    f = [0,0]
    print(f[99])
    exit()
    temp_x = x
    temp_y = x - k
    show_xy(temp_x, temp_y)
    temp_x = x + (k+x-y)//2
    temp_y += k - (k+x-y)//2
    show_xy(temp_x, temp_y)
    temp_x = x
    temp_y = y
    show_xy(temp_x, temp_y)
    exit()

c = (k - (x + y) % k) % k
if x + y < k:
    n = 2
else:
    n = (x + y) // k + (c % 2)
    if (x + y) // k != 0:
        n += 1

print(n)

ans = 0
temp_x = 0
temp_y = 0

temp = - (k * n - x - y) // 2
while 1:
    temp_y -= k
    if temp_y >=  temp:
        show_xy(temp_x, temp_y)
    else:
        temp_x = temp - temp_y
        temp_y = temp
        #print(temp_x * a, temp_y * b)
        break

while temp_x <= x:
    show_xy(temp_x, temp_y)
    temp_x += k

temp_y += temp_x - x
temp_x = x

while temp_y <= y:
    show_xy(temp_x, temp_y)
    temp_y += k


### FIXED CODE ###

import math

k = int(input())
x, y = map(int, input().split())

if k % 2 == 0 and (x + y) % 2 == 1:
    print(-1)
    exit()

a = 1
b = 1
d = 0
if x < 0:
    x *= -1
    a = -1
if y < 0:
    y *= -1
    b = -1
if x < y:
    d = 1
    x, y = y, x

def show_xy(tx, ty):
    if d == 1:
        print(ty * a, tx * b)
    else:
        print(tx * a, ty * b)

if x + y < k and (x + y) % 2 == 1:
    print(3)
    temp_x = x
    temp_y = x - k
    show_xy(temp_x, temp_y)
    temp_x = x + (k+x-y)//2
    temp_y += k - (k+x-y)//2
    show_xy(temp_x, temp_y)
    temp_x = x
    temp_y = y
    show_xy(temp_x, temp_y)
    exit()

c = (k - ((x + y) % k)) % k
if x + y < k:
    n = 2
else:
    n = math.ceil((x + y) / k) + (c % 2)

print(n)

ans = 0
temp_x = 0
temp_y = 0

temp = - (k * n - x - y) // 2
while 1:
    temp_y -= k
    if temp_y >=  temp:
        show_xy(temp_x, temp_y)
    else:
        temp_x = temp - temp_y
        temp_y = temp
        #print(temp_x * a, temp_y * b)
        break

while temp_x <= x:
    show_xy(temp_x, temp_y)
    temp_x += k

temp_y += temp_x - x
temp_x = x

while temp_y <= y:
    show_xy(temp_x, temp_y)
    temp_y += k
def main():
    def f(k):
        if k < min_a:
            return False
        if k in a:
            return True
        if dp[k] != -1:
            return dp[k]
        for v in a:
            if k >= v:
                if not f(k-v):
                    dp[k] = True
                    return True
        dp[k] = False
        return False

    inp = lambda: [int(x) for x in input().split()]    
    n, k = inp()
    a = inp()
    min_a = min(a)
    dp = [-1] * (k+1)
    ans = "First" if f(k) else "Second"
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    inp = lambda: [int(x) for x in input().split()]    
    n, k = inp()
    a = inp()
    min_a = min(a)
    dp = [False] * (k+1)
    for i in range(k + 1):
        if i < min_a:
            dp[i] = False
        elif i in a:
            dp[i] = True
        else:
            for j in a:
                if i >= j and not dp[i-j]:
                    dp[i] = True
                    break

    ans = "First" if dp[k] else "Second"
    print(ans)


if __name__ == '__main__':
    main()
nums = list(map(int,input().split())
nums.sort()
if nums[0] == 5 and nums[1] == 5 and nums[2] == 7:
            print("YES")
else:
            print("NO")

### FIXED CODE ###

nums = list(map(int,input().split()))
nums.sort()
if nums[0] == 5 and nums[1] == 5 and nums[2] == 7:
            print("YES")
else:
            print("NO")
import sys #追加
sys.setrecursionlimit(500*500)

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

time = 0
cnt = 0
ans = 0
ai = -1
bi = -1

def dfs(time, cnt):
    global ans, ai, bi
    # print(time)
    if time > K:
        # print(cnt)
        ans = max(ans, cnt-1)
        return
    if ai <= N-2:
        ai += 1
        dfs(time+A[ai], cnt+1)
    if bi+1 <= M-2:
        bi += 1
        dfs(time+B[bi]+1, cnt+1)

if sum(A)+sum(B)<=K:
    print(N+M)
else:
    dfs(0, 0)
    print(ans)

### FIXED CODE ###

from itertools import accumulate

N, M, K = map(int, input().split())
A = list(accumulate([0] + list(map(int, input().split()))))
B = list(accumulate([0] + list(map(int, input().split()))))


ans, j = 0, M

for i in range(N+1):
    if A[i] > K:
        break
    while B[j] > K-A[i]:
        j -= 1
    ans = max(ans, i+j)


print(ans)
A, B, C, D = (int(i) for i in input().split())
if D > B and A > C:
    E = (C - (D - B))
    F = D - (A - C)
    G = (A - (D - B))
    H = B - (A - C)
    print(E, F, G, H)
elif A > C and B > D:
    E = C + (B - D)
    F = D - (A - C)
    G = A + (B - D)
    H = B - (A - C)
    print(E, F, G, H)
elif B > D and C > A:
    E = (C + (B - D))
    F = D + (C - A)
    G = (A + (B - D))
    H = B + (C - A)
    print(E, F, G, H)
else:
    E = C - (D - B)
    F = D + (C - A)
    G = A - (D - B)
    H = B + (C - A)
    print(E, F, G, H)

### FIXED CODE ###

K = int(input())
if K % 2 == 0:
    A = (K // 2) * (K // 2)
    print(A)
else:
    B = ((K // 2) + 1) * (K // 2)
    print(B)
H, W = map(int, input().split())
table = []
table.append(list("_" * (W + 2)))
for _ in range(H):
    table.append(list("_" + input() + "_"))
table.append(list("_" * (W + 2)))

for h in range(1, H + 1):
    for w in range(1, W + 1):
        if table[h][w] == "#":
            continue
        count = 0
        print(h, w, "---------")
        for _h in [-1, 0, +1]:
            for _w in [-1, 0, +1]:
                print(h + _h, w + _w)
                if table[h + _h][w + _w] == "#":
                    count += 1
        table[h][w] = str(count)

for h in range(1, H + 1):
    print("".join(table[h]).replace("_", ""))


### FIXED CODE ###

a, b, c = input().split(" ")

if a == b:
    print(c)
elif a == c:
    print(b)
else:
    print(a)