Harryxun/stf_run huggingface dataset:
N,M,X=[int(x) for x in input().rstrip().split()]
l=[]
for i in range(N):
  ca=[int(x) for x in input().rstrip().split()]
  l.append(ca)

A=[0 for i in range(M+2)]
flag=1
ans=float('inf')
cnt=0
for i in range(2**N):
  flag=1
  cost=0
  for j in range(N):
    if i>>j & 1:
      now=l[N-j-1]
      cost+=now[0]
      for s in range(M):
        A[s]+=now[s+1]
  for t in range(M):
    if X<=A[t]:
      continue
    else:
      flag=0
      break
  if flag==1:
    ans=min(ans,cost)
    cnt+=1

  A=[0 for v in range(N)]

if cnt==0:
  print(-1)
else:
  print(ans)
      



### FIXED CODE ###

N,M,X=[int(x) for x in input().rstrip().split()]
l=[]
for i in range(N):
  ca=[int(x) for x in input().rstrip().split()]
  l.append(ca)

A=[0 for i in range(M+2)]
flag=1
ans=10**10
cnt=0
for i in range(2**N):
  flag=1
  cost=0
  for j in range(N):
    if i>>j & 1:
      now=l[N-j-1]
      cost+=now[0]
      for s in range(M):
        A[s]+=now[s+1]
  for t in range(M):
    if X<=A[t]:
      continue
    else:
      flag=0
      break
  if flag==1:
    ans=min(ans,cost)
    cnt+=1

  A=[0 for v in range(M+2)]

if cnt==0:
  print(-1)
else:
  print(ans)
H,A=,map(int,input().split())
 
n=(H//A)+1

if H%A==0:
  n=H//A
else:
  n=(H//A)+1
print(n)

### FIXED CODE ###

H,A=map(int,input().split())
 
n=(H//A)+1
 
if H%A==0:
  n=H//A
else:
  n=(H//A)+1
print(n)
A,B=map(int,input().split())
print((A*(B*100))/100)


### FIXED CODE ###

A,B=input().split()
A =int(A)
B =int(B.replace('.', ''))
print(A*B//100)
from sys import exit
from math import gcd

def eratosthenes(n):
    '''
    n以下の整数の素数判定/列挙 (n > 1)
    O(NloglogN)
    '''
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    min_factor = [-1] * (n+1)
    min_factor[0] = 0
    min_factor[1] = 1
    
    for i in range(2, n+1):
        if is_prime[i]:
            min_factor[i] = i
            for j in range(i*2, n+1, i):
                is_prime[j] = False
                if min_factor[j] == -1:
                    min_factor[j] = i

    return min_factor


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

l = eratosthenes(20)

flag = True
used = [False] * (20)
for v in a:
    s = set()
    while v > 1:
        if l[v] not in s:
            if used[l[v]]:
                flag = False
                break
            else:
                s.add(l[v])
                used[l[v]] = True
        
        v //= l[v]

if flag:
    print('pairwise coprime')
    exit()

g = 0
for v in a:
    g = gcd(g, v)

print('setwise coprime' if g == 1 else 'not coprime')

### FIXED CODE ###

from sys import exit

def eratosthenes(n):
    '''
    n以下の整数の素数判定/列挙 (n > 1)
    O(NloglogN)
    '''
    for i in range(2, int(n**0.5) + 1):
        if is_prime[i]:
            for j in range(i*2, n+1, i):
                is_prime[j] = False

    return [i for i in range(n+1) if is_prime[i]]


def factorization(n):
    '''
    素因数分解
    O(√N)
    '''
    res = []
    m = 2
    while m ** 2 <= n:
        if n % m == 0:
            cnt = 0
            while n % m == 0:
                cnt += 1
                n //= m
            res.append([m, cnt])
        m += 1

    if n > 1:
        res.append([n, 1])

    return res


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

is_prime = [True] * (10**6+1)
is_prime[0] = False
is_prime[1] = False
judge = [False] * (10**6+1)
l1 = eratosthenes(10**6)

flag1 = True
for v1 in a:
    for v2 in l1:
        if is_prime[v1]:
            if judge[v1]:
                flag1 = False
            else:
                judge[v1] = True
            break

        if v1 % v2 == 0:
            if judge[v2]:
                flag1 = False
            else:
                judge[v2] = True
            
            while v1 % v2 == 0:
                v1 //= v2
        
        if v1 == 1:
            break
        
if flag1:
    print('pairwise coprime')
    exit()

l2 = factorization(a[0])
for i, j in l2:
    flag2 = True
    for v in a:
        if v % i != 0:
            flag2 = False
            break
    if flag2:
        print('not coprime')
        exit()

print('setwise coprime')
ab=list(map(int,input().split()))
a=ab[0]+ab[1]
b=ab[0]*ab[1]
c=ab[0]-ab[1]
flag=0
if a>b:
  if a>c:
    print(a)
    flag=1
else:
  if b>c:
    print(b)
    flag=1
if flag=0:
  print(c)

### FIXED CODE ###


ab=list(map(int,input().split()))
a=ab[0]+ab[1]
b=ab[0]*ab[1]
c=ab[0]-ab[1]
flag=0
if a>b:
  if a>c:
    print(a)
    flag=1
else:
  if b>c:
    print(b)
    flag=1
if flag==0:
  print(c)
import numpy as np
n,k,q=map(int,input().split())	
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
a=np.repeat(k,n)
for word in listA:
    a[word]-=1
result=[]
for i in range(len(a)):
    if a[i]<=0:
        print('No')
    else:
        print('Yes')

### FIXED CODE ###

import numpy as np
n,k,q=map(int,input().split())	
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(int(input()))
    except:
        break;
a=np.repeat(k-q,n)
for word in listA:
    a[word-1]+=1
result=[]
for i in range(len(a)):
    if a[i]<=0:
        print('No')
    else:
        print('Yes')
n=int(input())
h=list(map(int,input().split()))
ans=0
for i in range(0,n-1):
  if h[i]>=h[i+1]+2:
    ans+=1
    break
  elif h[i]==h[i+1]+1:
    if ans=1:
      break
    else:
      ans+=1
  else:
    ans=0
if ans==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
max=h[0]
for i in range(n):
    if h[i]>max:
        max=h[i]-1
    elif h[i]<max:
        print("No")    
        exit()
print("Yes")
import sys
input = sys.stdin.readline
N,K=map(int,input().rstrip().split())
h=list(map(int,input().rstrip().split()))

inf=10**9+7
dp=[inf]*N
dp[0]=0

for i in range(1,N,1):
    for k in range(1,K+1,1):
        if(i-k<0):
            continue
        dp[i]=min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))
print(dp[N-1])
  

### FIXED CODE ###

import sys
input = sys.stdin.readline
N=int(input().rstrip())
h=list(map(int,input().rstrip().split()))

dp=[0]*N
for i in range(N):
    dp[i]=1000000000000
dp[0]=0

for i in range(1,N,1):
    dp[i]=min(dp[i],dp[i-1]+abs(h[i]-h[i-1]))
    if(i>1):        
        dp[i]=min(dp[i],dp[i-2]+abs(h[i]-h[i-2]))

print(dp[N-1])
inp = input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )

### FIXED CODE ###

inp = raw_input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )
a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  if c > 0:
    a -= d
  else:
    print('Yes')
  if a <= 0
    print('No')


### FIXED CODE ###

a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  if c > 0:
    a -= d
    if a <= 0:
      print('No')
  else:
    print('Yes')
vdef main():
    n,i = map(int,input().split())

    print(n+1-i)

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n,i = map(int,input().split())

    print(n+1-i)

if __name__ == '__main__':
    main()
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))

max_value=max(A)
max_index=A.index(max_value)
second_value=A.sort()[-2]

for j in range(N):
    if i==max_index:
        print(second_value)
    else:
        print(max_value)

### FIXED CODE ###

import copy

N=int(input())
A=[]
for _ in range(N):
    A.append(int(input()))

A_max=max(A)
ind_max=A.index(A_max)
B=copy.copy(A)
B.remove(A_max)
B_max=max(B)

for i in range(N):
    if A[i]!=A_max:
        print(A_max)
    else:
        print(B_max)
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            try: 
                if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                    tmp_color += 1
                colors[edge[1]] = tmp_color
            except Exception as e:
                print(0)
                exit(0)
            paint(edge[0], edge[1])
            tmp_color += 1

    

paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
import sys
sy=sys.stdin.readline

n=int(sy())
dp=[0]*(n+1)
lis=[0]*(n+1)
dp[0],dp[1],dp[2]=0,1,1
c1=int(sy())
c2=int(sy())
lis[c1]=1
lis[c2]=2
for i in range(3,n+1):
    c1=c2
    c2=int(sy())
    if c1==c2 or lis[c2]==0:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1]+dp[lis[c2]]
    lis[c2]=i
    dp[i]%=1000000007
print(dp[n])

### FIXED CODE ###

import sys
sy=sys.stdin.readline

n=int(sy())
if n==1:
    print(1)
    quit()
dp=[0]*(n+1)
lis=[0]*(2*10**5+1)
dp[0],dp[1],dp[2]=0,1,1
c1=int(sy())
c2=int(sy())
lis[c1]=1
lis[c2]=2
for i in range(3,n+1):
    c1=c2
    c2=int(sy())
    if c1==c2 or lis[c2]==0:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1]+dp[lis[c2]]
    lis[c2]=i
    dp[i]%=1000000007
print(dp[n])
nums = input()
numlist = list(nums.split(' '))

if numlist[0] = "0"
print(0)

elif numlist[1] = "0"
print(1)

elif numlist[2] = "0"
print(2)

elif numlist[3] = "0"
print(3)

elif numlist[4] = "0"
print(4)


### FIXED CODE ###

# coding: utf-8
# Your code here!
x=input().split()



if(x[0]=="0"):
    print(1)
elif(x[1]=="0"):
    print(2)
elif(x[2]=="0"):
    print(3)
elif(x[3]=="0"):
    print(4)
elif(x[4]=="0"):
    print(5)
n = int(input())
a = list(map(int, input().split()))
a.sort()

ans = 0
for i in range(n):
    cnt = 0
    if i > 0 and a[i] == a[i - 1]:
        continue
    for j in range(i):
        if a[j] > a[i] // 2:
            break
        if a[i] % a[j] == 0:
            cnt += 1
            break
    if cnt == 0:
        if i != 0:
            # print(i, a[i])
            ans += 1
        elif a[0] != a[1]:
            # i == 0
            ans += 1

print(ans)


### FIXED CODE ###

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

cnt = [0] * (a[-1] + 1)
for i in range(n):
    cnt[a[i]] += 1

ans = 0
for i in range(1, a[-1] + 1):
    if cnt[i] > 0:
        if cnt[i] == 1:
            ans += 1
        for j in range(2, a[-1] + 1):
            na = i * j
            if na <= a[-1]:
                cnt[na] = 0
            else:
                break

print(ans)
import numpy as np

def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    A = np.array(A)
    A.sort()
    zero = np.count_nonzero(A==0)
    positive = A[A>0]
    negative = A[A<0]
    def count(x): # 積がx以下になるペアの個数を返す
        ans = 0
        if x >= 0:
            ans += N*zero
        ans += np.searchsorted(A, x//positive, side="right").sum()
        ans += N*len(negative) - np.searchsorted(A, -(-x//negative), side="left").sum()
        ans -= np.count_nonzero(A*A <= x) # 同じものはふたつ選べない
        return ans//2
    ok = 10**8
    ng = -ok-1
    while ok-ng>1:
        cur = (ok+ng)//2
        if count(cur)>=K:
            ok = cur
        else:
            ng = cur
    print(int(ok))


    
if __name__ == "__main__":
    main()

### FIXED CODE ###


import numpy as np

def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    A = np.array(A)
    A.sort()
    zero = np.count_nonzero(A==0)
    positive = A[A>0]
    negative = A[A<0]
    def count(x): # 積がx以下になるペアの個数を返す
        ans = 0
        if x >= 0:
            ans += N*zero
        ans += np.searchsorted(A, x//positive, side="right").sum()
        ans += N*len(negative) - np.searchsorted(A, -(-x//negative), side="left").sum()
        ans -= np.count_nonzero(A*A <= x) # 同じものはふたつ選べない
        return ans//2
    ok = 10**18
    ng = -ok-1
    while ok-ng>1:
        cur = (ok+ng)//2
        if count(cur)>=K:
            ok = cur
        else:
            ng = cur
    print(int(ok))


    
if __name__ == "__main__":
    main()
line = input()
numbers = [int(n) for n in line.split()]
predicted_value = "Yay!"
k_distance = numbers[-1]
antenas = numbers[:-1]
antenas.sort()
if antenas[-1] - antenas[0] > k_distance:
    predicted_value = ":("
print(predicted_value)

### FIXED CODE ###

xs = []
for _ in range(5):
    x = int(input())
    xs.append(x)
k = int(input())

ok = False
for i in xs:
    for j in xs:
        if max(i, j) - min(i, j) > k:
            ok = True

print(':(') if ok else print('Yay!')
a, b, k = map(int, input().split())

def ooo(x):
    list =[]
    for i in range(1, x+1):
        if x % i == 0:
            li.append(i)
    return li

lia = ooo(a)
lib = ooo(b)
li = lia + lib

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])

### FIXED CODE ###

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

def ooo(x):
    lix =[]
    for i in range(1, x+1):
        if x % i == 0:
            lix.append(i)
    return lix

lia = ooo(a)
lib = ooo(b)
li = lia + lib

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])
while True :                                                                                        
  4     a,b = map(int,raw_input().split())                                                              
  5                                                                                                     
  6     if a ==0 and b==0 :                                                                             
  7         break                                                                                       
  8     else:                                                                                           
  9         if a > b:                                                                                   
 10             print b,a                                                                               
 11         else:                                                                                       
 12             print a,b

### FIXED CODE ###

while True :
    a,b = map(int,raw_input().split())

    if a ==0 and b==0 :
        break
    else:
        if a > b:
            print b,a
        else:
            print a,b
import math
a,b,c,d = map(int,input().split())
lcm = c*d // math.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
sum = B-A
print( b-a+1-sum )

### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
lcm = c*d // fractions.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
ans = B-A
print(b-a+1-ans)
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst[n]+abs(a[n-1])
lst2[n+1]=lst[n]+abs(a[0])
for i in range(n):
  print(lst1[i]+lst2[n-i]+abs(a[min(n-1,i+1)]-a[max(0,i-1)]))

 


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
list1=[abs(a[0])]*(n+1)
list2=[abs(a[n-1])]*(n+1)
for i in range(n-1):
  list1[i+1]=list1[i]+abs(a[i+1]-a[i])
  list2[i+1]=list2[i]+abs(a[n-i-1]-a[n-i-2])
list1[n]=abs(a[n-1])
list2[n]=abs(a[0])
print(list2[n-2]+abs(a[1]))
for i in range(1,n-1):
  print(list2[n-2-i]+list1[i-1]+abs(a[i+1]-a[i-1]))
print(list1[n-2]+abs(a[n-2]))
def main():
    X = int(input())
    A = [False]*(10**5 + 1)
    A[100] = True
    A[101] = True
    A[102] = True
    A[103] = True
    A[104] = True
    A[105] = True
    for i in range(100,X+1):
        if A[i]:
            A[i+100] = True
            A[i+101] = True
            A[i+102] = True
            A[i+103] = True
            A[i+104] = True
            A[i+105] = True
    if A[X]:
        print(1)
    else:
        print(0)
    return 

main()

### FIXED CODE ###


def main():
    X = int(input())
    A = [False]*(110000)
    A[100] = True
    A[101] = True
    A[102] = True
    A[103] = True
    A[104] = True
    A[105] = True
    for i in range(100,X+1):
        if A[i]:
            A[i+100] = True
            A[i+101] = True
            A[i+102] = True
            A[i+103] = True
            A[i+104] = True
            A[i+105] = True
    if A[X]:
        print(1)
    else:
        print(0)
    return 

main()
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

### FIXED CODE ###

s= input()
a = 0
for i in range(len(s)):
    if i%2:
        if s[i]=="R":
            a = 1
            break
    else:
        if s[i]=="L":
            a = 1
            break
if a == 0:
    print('Yes')
else:
    print('No')
import numpy as np

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)


### FIXED CODE ###

import numpy as np

N = int(input())
a = [input() for _ in range(N)]

a = np.sort(np.array(a))

unique_elements, index_elements = np.unique(a, return_index = True)
l = []
for i in range(index_elements.size -1):
  m = index_elements[i + 1] - index_elements[i]
  l.append(m)
l.append(a.size - index_elements[-1])    
elements = unique_elements[l == max(l)]


for i in elements:
	print(i)
N = int(input().strip())



a = []
c =0
f = 0

for i in range(N):
    array = list(map(int, input().strip().split()))
    a.append(array)

    
for i in range(N):
	if(f == 0 or f == i-1):
		if(a[i][0] == a[i][1]):
			f=i
			c+=1
		else:
			f=0
			c=0
	else :
      f=0
      c=0

if(c >= 3):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

val = input()

if(val[-1] == 's'):
  print(val + 'es')
else:
  print(val+'s')
import math
A, B = map(int, input().split())
print (int(A * B // (math.gcd(A,B))))

### FIXED CODE ###

import fractions
A, B = map(int, input().split())
print (int(A * B // (fractions.gcd(A,B))))
import bisect
from collections import deque
n,m = map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))

lis = [[]for i in range(m)]

for i in range(n):
    if ab[i][0]<=m:
        lis[ab[i][0]-1].append(ab[i][1])

pys = deque([])
sum = 0
for i in range(m):
    tmp = lis[i]
    if tmp:
        for j in tmp:
            bisect.insort(pys,j)
    if pys:
        sum+=pys.pop()

print(sum)


### FIXED CODE ###

#import bisect
import heapq
from collections import deque
n,m = map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))

lis = [[]for i in range(m)]

for i in range(n):
    if ab[i][0]<=m:
        lis[ab[i][0]-1].append(ab[i][1])

pys = []
heapq.heapify(pys)
sum = 0
for i in range(m):
    tmp = lis[i]
    if tmp:
        for j in tmp:
            heapq.heappush(pys,-j)
    if pys:
        sum-=heapq.heappop(pys)

print(sum)
S=input()
for i in range(len(S)):
  print("x",enmd="")

### FIXED CODE ###

S=input()
for i in range(len(S)):
  print("x",end="")
def UnlikeNum(nums,price):
    for num in nums:
        if(str(num) in str(price)):
            return True
    
    return False

N, K = map(int,input().split())
D = [int(input()) for k in range(K)]
while(UnlikeNum(D,N)):
    N+=1
print(N)

### FIXED CODE ###

def UnlikeNum(nums,price):
    for num in nums:
        if(str(num) in str(price)):
            return True
    
    return False

N, K = map(int,input().split())
D = list(map(int,input().split()))
while(UnlikeNum(D,N)):
    N+=1
print(N)
n = int(input())
s = input()
for i in range(len(s)):
  c = (ord(s[i]) + n - ord('A')) % 26
  c += ord('A')
  s[i] = chr(c)
 print(s)

### FIXED CODE ###

n = int(input())
s = list(input())
for i in range(len(s)):
  c = (ord(s[i]) + n - ord('A')) % 26
  c += ord('A')
  s[i] = chr(c)
print("".join(s))
a,b,c = map(int,input().split())
if a ==b:
    print(c)
elif a==c:
    print(b)
else print(a)

### FIXED CODE ###

a,b,c = map(int,input().split())
if a ==b:
    print(c)
elif a==c:
    print(b)
else: 
    print(a)
n,m=map(int,input().split())
AdjacencyMatrix=[[0]*n for i in [0]*m]
for i in [0]*m:
  a,b=map(int,input().split())
  AdjacencyMatrix[a-1][b-1]=1
  AdjacencyMatrix[b-1][a-1]=1
#print(AdjacencyMatrix)

def DFS(point,TFlist):
#  print(TFlist)
  if not False in TFlist:
    return 1
  ans=0
  for i in range(n):
    if not AdjacencyMatrix[point][i]:
      continue  #AMの0なら処理せず
    if TFlist[i]:
      continue  #探索済みなら処理せず
    TFlist[i]=True #探索したのでTFlistをTrue
    ans+=DFS(i,TFlist) #再帰的にansを加算
    TFlist[i]=False #枝を戻すためにTFlistをFalse
  return ans

TFlist=[True]+[False]*(n-1)
print(DFS(0,TFlist))

### FIXED CODE ###

n,m=map(int,input().split())
AdjacencyMatrix=[[0]*n for i in [0]*n]
for i in [0]*m:
  a,b=map(int,input().split())
  AdjacencyMatrix[a-1][b-1]=1
  AdjacencyMatrix[b-1][a-1]=1
#print(AdjacencyMatrix)

def DFS(point,TFlist):
#  print(TFlist)
  if not False in TFlist:
    return 1
  ans=0
  for i in range(n):
    if not AdjacencyMatrix[point][i]:
      continue  #AMの0なら処理せず
    if TFlist[i]:
      continue  #探索済みなら処理せず
    TFlist[i]=True #探索したのでTFlistをTrue
    ans+=DFS(i,TFlist) #再帰的にansを加算
    TFlist[i]=False #枝を戻すためにTFlistをFalse
  return ans

TFlist=[True]+[False]*(n-1)
print(DFS(0,TFlist))
from collections import Counter

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

if len(set(V)) == 1:
    ans = len(V) // 2
else:
    vp_ = [v for i, v in enumerate(V) if i%2 == 0] 
    vn_ = [v for i, v in enumerate(V) if i%2 != 0] 

    vp = Counter(vp_).most_common()
    vn = Counter(vn_).most_common()

    if vp[0][0] != vn[0][0]:
        gp = vp[0][1]
        gn = vn[0][1]
    else:
        if vp[0][1] > vn[0][1]:
            gp = vp[0][1]
            gn = vn[1][1]
        elif vp[0][1] < vn[0][1]:
            gp = vp[1][1]
            gn = vn[0][1]
        else vp[0][1] == vn[0][1]:
            if vp[1][1] >= vn[1][1]:
                gp = vp[1][1]
                gn = vp[0][1]
            else:
                gp = vp[0][1]
                gn = vp[1][1]
 
    ans = n - gp - gn
print(ans)

### FIXED CODE ###

from collections import Counter

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

if len(set(V)) == 1:
    ans = len(V) // 2
else:
    vp_ = [v for i, v in enumerate(V) if i%2 == 0] 
    vn_ = [v for i, v in enumerate(V) if i%2 != 0] 

    vp = Counter(vp_).most_common()
    vn = Counter(vn_).most_common()

    if vp[0][0] != vn[0][0]:
        gp = vp[0][1]
        gn = vn[0][1]
    else:
        if vp[0][1] > vn[0][1]:
            gp = vp[0][1]
            gn = vn[1][1]
        elif vp[0][1] < vn[0][1]:
            gp = vp[1][1]
            gn = vn[0][1]
        else:
            if vp[1][1] >= vn[1][1]:
                gp = vp[1][1]
                gn = vn[0][1]
            else:
                gp = vp[0][1]
                gn = vn[1][1]
 
    ans = n - gp - gn
print(ans)