peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
kisu=0
for i in range(1,n+1):
  if i%2==1:
    kisu+=1
print(kisu/n)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(0)
else :
  prod = 1
  for x in a:
    prod *= x
    if prod > 10**18:
      print(-1)
      break
  else :
    print(prod)
# Judge status: Accepted
s = input()
ans = "AC"
c = 0
for i in range(len(s)):
    if i==0 and s[i]!="A":
        ans = "WA"
    if i>=2 and i<len(s)-1:
        if s[i]=="C":
            c += 1
        elif ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
    if i==1 or i==len(s)-1:
        if ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
if c!=1:
    ans = "WA"
print(ans)
# Judge status: Accepted
N, R = map(int, input().split())

if N < 10:
	print(R+(10-N)*100)
else:
	print(R)
# Judge status: Wrong Answer
a,b=map(int,input().split())
n=999
l=[1]*n
for i in range(1,n):
    l[i]=l[i-1]+(i+1)
    if l[i-1]<=a<l[i]:
        print(l[i]-a)
        break
# Judge status: Accepted
T = list(input())
tlen = len(T)

for i in range(0, tlen):
  if T[i] == '?':
    T[i] = 'D'
    
print(*T,sep='')
# Judge status: Accepted
mod = 1000000007

N = int(input())
memo = [0]*(N+1)
for i in range(3,N+1):
    tmp = 1
    for j in range(i-3):
        tmp += memo[j+1]
    memo[i] = tmp%mod
print(memo[-1])
# Judge status: Accepted
n = int(input())

def chrinc(s,n):
  return chr(ord(s)+1)

def dfs(s,mx):
  if len(s) == n:
    print(s)
  else:
    c = 'a'
    while c <= mx:
      dfs(s+c, chrinc(mx,1) if c==mx else mx)
      c = chrinc(c,1)

dfs('','a')
# Judge status: Accepted
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
if N>=M: print(0);exit()
if N==1: print(X[-1]-X[0]);exit()
L = []
for i in range(len(X)-1):
    L.append(X[i+1]-X[i])
L.sort()
L = L[:-(N-1)]
print(sum(L))
# Judge status: Accepted
N = int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
print(num2alpha(N).lower())
# Judge status: Wrong Answer
s = input()
sa = 0
sz = 0
for i in range(len(s)):
    if sa == 0 and s[i] == "A":
        sa = i
    if s[i] == "Z":
        sz = i
print(sz-sa+1)
# Judge status: Accepted
n = 0
H1,M1,H2,M2,K = map(int,input().rstrip().split(" "))
n = (H2 - H1)  * 60 + (M2 - M1)
print(n - K)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

flg = None
cur = a[0]
cnt = 1

for v in a[1:]:
  if v > cur:
    if flg is None:
      flg = True
    if not flg:
      flg = None
      cnt += 1
  if v < cur:
    if flg is None:
      flg = False
    if flg:
      cnt += 1
      flg = None
  cur = v
print(cnt)
# Judge status: Wrong Answer
from collections import deque
n,m=map(int,input().split())
lmoney=[]
for _ in range(n):
    a,b=map(int,input().split())
    if a<=m:
        lmoney.append([b,a])
lmoney=sorted(lmoney,reverse=True)
q=deque()
for i in lmoney:
    q.append(i)
day=0
money=0

while day<=m and q:
    job=q.popleft()
    if job[1]<=m-day:
        money+=job[0]
        day+=1
        
print(money)
# Judge status: Accepted
s = list(input())
red = s.count("0")
blue = len(s) - red

print(min(red, blue)*2)
# Judge status: Accepted
def main():
    a=int(input())
    print(a*(1+a+a*a))
main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
col1 = []
col2 = []
for i in a:
    if i//400<8:
        col1.append(i//400)
    else:
        col2.append(i//400)
min = len(set(col1))
if min == 0:
    min = 1
max = len(set(col1))+len(col2)

print(min, max)
# Judge status: Accepted
a, b = map(str,input().split())
c = int(a+b)

d = c ** (1/2)
if d.is_integer():
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A,B,C,X,Y = map(int,(input().split()))

#ABピザの最大枚数
limit = max(X,Y)*2
Min = 10**10

for i in range(limit+1):
    a=0
    b=0
    c=0
    
    if i/2 < X:
        a = (X-int(i/2)) *A
    if i/2 < Y:
        b= (Y-int(i/2))*B    
        
    c = i*C
    
    Min = min(Min,a+b+c)
    
    
    
print(Min)
# Judge status: Accepted
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
for i in range(n-2):
  if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
    print('Yes')
    exit()
print('No')
# Judge status: Wrong Answer
N = int(input())
D = sorted(map(int, input().split()))
print(D)
if D[N//2 - 1] == D[N//2]:
  print(0)
else:
  print(D[N//2] - D[N//2 - 1])
# Judge status: Accepted
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
  S=str(i)
  if S[0]==S[4] and S[1]==S[3]:
    cnt+=1
print(cnt)
# Judge status: Accepted
N= input()
a= int(N[-1])

if(a== 3):
  print("bon")
elif(a== 0 or a== 1 or a== 6 or a== 8):
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
N = int(input())
power = 1
for i in range(1, N+1):
  power *= i
  power %= 1e9 + 7
print(power)
# Judge status: Accepted
S= input()

if len(S) %2 != 0:
  print('No')
  exit()
number = len(S)//2
if 'hi'*number == S:
  print('Yes')
  exit()
print('No')
# Judge status: Accepted
N,A,B =list(map(int, input().split()))
S = input()
C = A+B
a_number = 0
b_number= 0
for i in S:
    if i == "a" and a_number< C:
        print("Yes")
        a_number = a_number+1
    elif i == "b" and a_number<C and b_number<B:
        print("Yes")
        a_number = a_number + 1
        b_number = b_number +1
    else:
        print("No")
# Judge status: Accepted
x, n = map(int, input().split())
s = list(map(int, input().split()))
for j in range(n):
    s[j] = s[j] - x

i = 0
while True:
    if -i not in s:
        print(x-i)
        exit()
    if i not in s:
        print(x+i)
        exit()
    i += 1
# Judge status: Accepted
from itertools import permutations
from math import factorial
n=int(input())
XY=[list(map(int,input().split())) for _ in range(n)]

ans=0
for A in permutations(XY,n):
    cnt=0
    for j in range(n-1):
        cnt +=((A[j][0]-A[j+1][0])**2+(A[j][1]-A[j+1][1])**2)**0.5
    ans +=cnt
print(ans/factorial(n))
# Judge status: Accepted
a, b, x = map(int,input().split())

if a > x:
  print("NO")
  
elif (a + b) >= x:
  print("YES")
  
else:
  print("NO")
# Judge status: Accepted
n=int(input())
a=int(input())

amari=int(n%500)

if amari<=a:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
c = [list(map(int, input().split())) for _ in [0]*3]
a = [0]*3
b = [0]*3
for i in range(3):
    b[i] = c[0][i] - a[0]
for i in range(3):
    a[i] = c[i][0] - b[0]
for i in range(3):
    for j in range(3):
        if a[i] + b[j] != c[i][j]:
            print('No')
            exit()
print('Yes')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

max_count = sum(b) - sum(a)
count = 0
for i in range(n):
    if a[i] > b[i]:
        count += (a[i] - b[i])
    elif a[i] < b[i]:
        if (b[i] - a[i]) % 2 == 0:
            count += (b[i] - a[i]) // 2
        else:
            count += (b[i] - a[i]) // 2 + 1
    else: continue

if count <= max_count:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
results = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
N = int(input())
for _ in range(N):
  S = input()
  results[S] = results[S] + 1

for k, v in results.items():
  print(k, 'x', v)
# Judge status: Accepted
ans=0
S=T=''
for i in input():
    S+=i
    if S!=T:
        ans+=1
        S,T='',S
print(ans)
# Judge status: Accepted
n = int(input())
A = []
B = []
for i in range(n):
  a,b = map(int,input().split())
  A.append(a)
  B.append(b)
A.sort()
B.sort()
if n%2 == 1:
  print(B[(n-1)//2] - A[(n-1)//2] + 1)
else:
  M = B[n//2 - 1] + B[n//2]
  m = A[n//2 - 1] + A[n//2]
  ans = M-m+1
  print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
S = input()
x, y = 0, 0
if S[0] == "L":
    y += 1
if S[-1] == "R":
    y += 1
x = S.count("RL")
if x:
    if x > K:
        x -= K
        K = 0
    else:
        K -= x
        x = 0
if K > 0:
    y = max(1, y - K)
print(N - 2 * x - y)
# Judge status: Accepted
A, B, N = map(int, input().split())
m = B - 1 if N >= B else N
print(A * m // B)
# Judge status: Wrong Answer

D = int(input())

print("christmas" + "Eve" * (25-D))
# Judge status: Accepted
N, A, B = map(int, input().split())
S = list(input())
f_cnt = 0
s_cnt = 0
for s in S:
  if s == 'a' and s_cnt < A + B:
    print('Yes')
    s_cnt += 1
  elif s == 'b' and s_cnt < A + B and f_cnt < B:
    print('Yes')
    s_cnt += 1
    f_cnt += 1
  else:
    print('No')
# Judge status: Accepted
x, a, b = map(int, input().split())
if (x - a) ** 2 < (x - b) ** 2:
    print('A')
else:
    print('B')
# Judge status: Wrong Answer
n = int(input())
a = sorted(map(int, input().split()))
print(a)

from operator import mul
from functools import reduce

def comb(n, r):
  r = min(r, n-r)
  numer = reduce(mul, range(n, n-r, -1), 1)
  denom = reduce(mul, range(1, r+1), 1)
  return numer // denom

from bisect import bisect_left
n = a[-1]
p = bisect_left(a, n//2) - 1

ans_r = -1
comb_max = 0
for i in range(p, n):
  c = comb(n, a[i])
  if c > comb_max:
    comb_max = c
    ans_r = a[i]
  else:
    break

print(n, ans_r)
# Judge status: Accepted
a,b,k = map(int, input().split())
ans=[]
for i in range(a,min(a+k,b)):
    ans.append(i)
for j in range(max(a,b-k+1),b+1):
    ans.append(j)
ans=list(set(ans))
ans.sort()
l=len(ans)
for i in range(l):
    print(ans[i])
# Judge status: Wrong Answer
import itertools

n, m, q = map(int, input().split())
abcd = []
a_pre = [] 


for i in range(q):
  abcd.append(list(map(int, input().split())))

lis = [i for i in range(1,m+1)]
for pair in itertools.combinations(lis, n):
  a_pre.append(list(pair))

sum = 0
for i in range(len(a_pre)):
  sum_pre = 0
  for j in range(len(abcd)):
    if a_pre[i][abcd[j][1] - 1] - a_pre[i][abcd[j][0] - 1] == abcd[j][2]:
      sum_pre = sum_pre + abcd[j][3]
  if sum_pre > sum:
    sum = sum_pre

print(sum)
# Judge status: Accepted
from fractions import gcd


MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

lcm = A[0]

for a in A:
    lcm = (lcm * a) // gcd(lcm, a)

ans = 0
for a in A:
    ans += (lcm % MOD) * pow(a, MOD - 2, MOD)
    ans %= MOD

print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())

cnt = 0
for i in range(a, b):
  r = ''.join(list(reversed(str(i))))
  if i == int(r):
    cnt += 1
    
print(cnt)
# Judge status: Wrong Answer
import bisect
import math
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    logof2[i]=math.log(A[i],2)
#print(logof2)
for i in range(M):
    if logof2[N-1]<0:
        break
    else:
        buf=logof2.pop(N-1)
        buf=buf-1
        bisect.insort(logof2,buf)

    #print(logof2)
for i in range(N):
    mi=mi+math.floor(pow(2,logof2[i]))

print(mi)
# Judge status: Wrong Answer
import math
print(2**(math.ceil(math.log(float(input()),2)))-1)
# Judge status: Wrong Answer
from collections import defaultdict

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

cnt = 0
d = defaultdict(int)
for key in a:
    d[key] += 1

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

print(cnt)
# Judge status: Accepted
N = int(input())
v = list(map(int, input().split()))
V = sorted(v, reverse=True)
A = 0

while N > 1:
  v1 = V.pop()
  v2 = V.pop()
  A = (v1 + v2)/2
  V.append(A)
  N -= 1

print(V[0])
# Judge status: Accepted
n, m = map(int, input().split())
n = abs(n - 2)
m = abs(m - 2)
print(n * m)
# Judge status: Wrong Answer
n = int(input())

print(n*800-n/15*200)
# Judge status: Accepted
N, P = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0,0] for k in range(N+1)]
dp[0][0] = 1
for k in range(N):
    if A[k]%2 == 0:
        dp[k+1][0] = dp[k][0]*2
        dp[k+1][1] = dp[k][1]*2
    else:
        dp[k+1][0] = dp[k][0] + dp[k][1]
        dp[k+1][1] = dp[k][1] + dp[k][0]

print(dp[N][P])
# Judge status: Accepted
import math
N=int(input())
POS=False
for i in range(math.floor(N/7)+1):
  if (N-7*i)%4==0:
    POS = True
if POS:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b=map(int,input().split())
if a>=10 or b>=10:
  print(-1)
else:
  print(a*b)
# Judge status: Accepted
input()
s = list(map(int,input().split()))
t = sorted(s)
if s==t:
    print('YES')
else:
    ans = sum(1 for i,j in zip(s,t) if i!=j)
    print('NO' if ans>2 else 'YES')
# Judge status: Accepted
a,b=list(map(int,input().split()))
if a==b:
  print(0)
else:
  if (a+b)%2==0:
    print((a+b)//2)
  else:
    print("IMPOSSIBLE")
# Judge status: Wrong Answer
s = input().replace('eraser','').replace('dreamer','').replace('erase','').replace('dream','')
print('YES' if s=='' else 'NO')
# Judge status: Wrong Answer
n=int(input())
A = [list(map(str,input().split())) for i in range(n)]
A_s = sorted(A, key=lambda x: x[1], reverse=True)
A_ss = sorted(A_s, key=lambda x: x[0], reverse=False)
for i in range(n):
    print(A.index( A_ss[i])+1)
# Judge status: Wrong Answer
X = input().split()
if X == 1:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
N=int(input())
S=str(input())
letters = "abcdefghijklmnopqrstuvwxyz"
max_num=0
for i in range(1,len(letters)):
  S1 = S[0:i]
  S2 = S[i:N]
  count = 0
  for k in range(26):
    n1 = len([1 for x in S1 if x==letters[k]])
    n2 = len([1 for x in S2 if x==letters[k]])
    if n1>0 and n2>0:
      count = count + 1
  if max_num < count:
    max_num = count
print(max_num)
# Judge status: Accepted
def getter(i):
  res=0
  while True:
    res+=i%10
    i//=10
    if i==0:
      break
  return res
n=int(input())
digit=0
hoge=n
while True:
  hoge//=10
  if hoge==0:
  	break
  digit+=1
a=10**digit
if n-a>0:
  res=1+getter(n-a)
  print(res)
  exit()
else:
  print("10")
# Judge status: Wrong Answer
n = int(input())
array = [int(x) for x in input().split()]
ans = [0 for x in range(n)]
res = []
count = 0
for i in reversed(range(n)):
    a = array[i]
    if a == 1 and sum([x for x in ans[i::i+1]]) % 2 == 0:
        ans[i] = 1
        count += 1
        res.append(str(a))
    elif a == 0 and sum([x for x in ans[i::i+1]]) % 2 == 1:
        ans[i] = 1
        count += 1
        res.append(str(a))
print(count)
print(" ".join(res))
# Judge status: Wrong Answer
x=input().split()
dim=[int(x[0]),int(x[1]),int(x[2])]
print(dim)
if (dim[0]*dim[1]*dim[2])%2==0:
  print(0)
else:
  dim.remove(max(dim))
  print(dim[0]*dim[1])
# Judge status: Accepted
n, k = map(int, input().split())
ab = [0] * n
cnt = [0] * 100001
for i in range(n):
    a, b = map(int, input().split())
    cnt[a] += b
ans = 0
for num in range(1, 100002):
    ans += cnt[num]
    if ans >= k:
        print(num)
        break
# Judge status: Wrong Answer
a,b=map(int,raw_input().split())
if a==b:
  print "Draw"
elif a==1 or a>b:
  print "Alice"
else:
  print "Bob"
# Judge status: Accepted
X = int(input())

for a in range(-1000, 1001):
    A = a ** 5
    for b in range(-1000, 1000):
        B = b ** 5
        if A - B == X:
            print(a, b)
            exit()
print(-1, -1)
# Judge status: Accepted
N = int(input())

print(800*N -200*(N//15))
# Judge status: Accepted
a,b=map(int,input().split())
diff = b-a
tall = sum([i for i in range(1, diff+1)])
print(tall-b)
# Judge status: Accepted
n = int(input())

ans = 0

for i in range(1, n+1):
    if i%2 == 0:
        continue
    
    cnt = 0
    for j in range(1, i+1):
        if i%j == 0:
            cnt += 1
    
    if cnt == 8:
        ans += 1
        
print(ans)
# Judge status: Accepted
import itertools
N = int(input())
S = input()
out = S.count('R') * S.count('G') * S.count('B')

RGBs = list(itertools.permutations(['R', 'G', 'B'], 3))

for i in range(1, N):
  for j in range(N-i*2):
    if (S[j], S[j+i], S[j+i*2]) in RGBs:
      out -= 1
print(out)
# Judge status: Accepted
def main():
    s = input()
    dp = [0, 1]
    for c in s:
        x = int(c)
        a = dp[0] + x
        if a > dp[1] + 10 - x:
            a = dp[1] + 10 - x
        b = dp[0] + x + 1
        if b > dp[1] + 10 - x - 1:
            b = dp[1] + 10 - x - 1
        dp[0] = a
        dp[1] = b
    dp[1] += 1
    print(min(dp))

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]

button = 1
for i in range(n):
    button = a[button - 1]
    if button == 2:
        print(i + 1)
        exit(0)

print(-1)
# Judge status: Wrong Answer
N, M = input().split(' ')
N = int(N)
M = int(M)
citys = []
for i in range(M):
  a, b = input().split(' ')
  a = int(a)
  b = int(b)
  citys.append(a)
  citys.append(b)
print(citys)
for i in range(1, N+1):
  print(citys.count(i))
# Judge status: Wrong Answer
N,S=int(input()),input()
ans=0
for i in range(N):
    a=S[:i+1];b=S[i:]
    c=0;l=[]
    for j in range(i+1):
        if a[j] in b and (not a[j] in l):c+=1;l.append(a[j])
    ans=max(ans,c)
print(ans)
# Judge status: Accepted
k, s = map(int,input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
            z = s - x - y 
            if z <= k and z >= 0 :
                ans += 1

print(ans)
# Judge status: Accepted
n,y=map(int,input().split())
for i in range(n+1):
    for j in range(n+1-i):
        c=n-i-j
        if y==i*10000+j*5000+c*1000:
            print(i,j,c)
            exit()



print(-1,-1,-1)
# Judge status: Wrong Answer
import math
a,b,h,m=map(int,input().split())
t=abs(h/12-m/60)
print((a**2+b**2+2*a*b*math.cos(2*math.pi*t))**0.5)
# Judge status: Wrong Answer
import numpy as np

N = int(input())
L = sorted([int(i) for i in input().split()], reverse=True)
L = np.array(L)

ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        min_c = np.count_nonzero(L[j] > L[j+1:])
        max_c = np.count_nonzero(L[i] - L[j] >= L[j+1:])
        ans += min_c - max_c

print(ans)
# Judge status: Accepted
x, y= list(map(int, input().split()))
#a,b,c = list(input().split())
if x+y < 24:
    print(x+y)
else:
    print(x+y-24)
# Judge status: Wrong Answer
n, p = map(int, input().split())
a = list(map(int, input().split()))

jug = True
for i in range(n):
    a[i] % 2 == 1
    jug = False
    break

if jug:
    if p == 0:
        print(2 ** n)
    else:
        print(0)

else:
    print(2 ** (n - 1))
# Judge status: Accepted
A,B,C = list(map(int, input().split()))
count=0
while True:
    if A%2 ==1or B%2 ==1 or C%2 ==1:
        print(count)
        break
    elif  A==B and B==C and C==A:
        print(-1)
        break 
    elif A%2==0 and B%2==0 and C%2 == 0:
        A2 = 0.5*A
        B2 = 0.5*B
        C2 = 0.5*C
        A = B2+C2
        B = C2+A2
        C = A2+B2
        count=count+1
# Judge status: Wrong Answer
def main():
    N = int(input())
    A = []
    c = 1
    m = int(input())
    for _ in range(N-1):
        a = int(input())
        if a <= m:
            m = a
            c += 1
    print(c)
main()
# Judge status: Accepted
c=input()

print("vowel" if c in "aiueo" else "consonant")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
zr = 0
for i in range(n-1):
  if (a[i] <= 0 and a[i+1]>=0 and abs(a[i]) >= abs(a[i+1])) or (a[i]<0 and a[i+1]<0):
    a[i] *=-1
    a[i+1] *=-1
print(sum(a))
# Judge status: Wrong Answer
x = input()
# x = x.replace(1,14)
# replaceは，文字列しか使えない．
ls_x = x.split()

# xに入力した文字列たちを整数化

for i in range(len(ls_x)):
    ls_x[i] = int(ls_x[i])

print(ls_x)

if ls_x[0] == ls_x[1]:
    print("Draw")

if ls_x[0] == 1:
    print("Alice")

elif ls_x[1] == 1:
    print("Bob")

elif ls_x[0] > ls_x[1]:
    print("Alice")

elif ls_x[0] < ls_x[1]:
    print("Bob")
# Judge status: Wrong Answer
n,y = map(int,input().split())

ans = '-1 -1 -1'
for i in range(n+1):
    for j in range(n+1-i):
        #for k in range(n+1-i-j):
        d = y - (i * 10000 + j * 5000)
        if d >= 0 and d % 1000 == 0 and d//1000 <= n - i - j:
            ans = '{} {} {}'.format(i,j,d//1000)
            break
print(ans)
# Judge status: Accepted
W,a,b = map(int,input().split())

if a+W<b:
  print(b-a-W)
elif a<=b<=a+W or a<=b+W<=a+W:
  print(0)
else:
  print(a-b-W)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

if((A != B != C) and (A == B == C)):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
a,b = map(int,input().split())

if a <= b:
    print(a)
else:
    print(a-1)
# Judge status: Wrong Answer
lu = [2, 1]
x = int(input())
for i in range(2, x):
    lu.append(lu[i-1] + lu[i - 2])  
print(lu[x-1])
# Judge status: Accepted
c=input()

if c in "aiueo":
  print("vowel")
else:
  print("consonant")
# Judge status: Accepted
board = list(map(int, input().split()))
k = int(input())
sort_board = sorted(board, reverse=True)
for _ in range(k):
    sort_board[0] *= 2
print(sum(sort_board))
# Judge status: Accepted
n=int(input())
ar=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if(ar[i]==ar[j]):continue
            if(ar[j]==ar[k]):continue
            if(ar[i]+ar[j]>ar[k]):
                ans+=1
print(ans)
# Judge status: Wrong Answer
a, b, c, d, e, k = [int(input()) for _ in range(6)]
print('Yay!' if e-a < k else ':(')
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if a+1+b>d:
  print(min(a,d))
else:
  print(a-(d-a-b))
# Judge status: Accepted
from sys import stdin
import math

h, n = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]

sum = 0
for i in a:
    sum += i

if sum >= h:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort()
tmp = A[0]
for i in range(1,N):
  tmp = (tmp+A[i])/2
print(tmp)
# Judge status: Accepted
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(m):
    n -= a[i]
print(n if n >= 0 else -1)
# Judge status: Accepted
n = int(input())
n += 1

import copy

ans = 0
ans_c = 0

for i in reversed(range(n)):
    check = copy.copy(i)
    div = 0
    count = 0

    while div == 0:
        div = (i % 2)
        i = i // 2
        if div == 0:
            count += 1
        if i == 0:
            break
    if ans_c < count:
        ans = check
        ans_c = count
if ans == 0:
     ans += 1
        
print(ans)
# Judge status: Wrong Answer
s=input()
k=int(input())
ans=0
for i in range(len(s)):
    if s[i]!=1:
        print(s[i])
        break
    else:
        ans+=1
        if k<ans:
            print(1)
            break
# Judge status: Accepted
N = int(input())
an = list(map(int,input().split()))
ave  = round((sum(an)/N),0)
ans = 0

for i in an:
    ans += (i-ave)**2

print(int(ans))
# Judge status: Accepted
a = int(input())
s = 0
b = input().split(" ")
i = 1
while i <= a :
    if (i % 2 == 1) and (int(b[i-1]) % 2 == 1)  :
        s = s + 1
    i = i + 1
print(s)
# Judge status: Wrong Answer
A = input()
B = input()
C = 1

if (A == 1 or B == 1):
    C = 2
if (A == 2 or B == 2):
    C = 3

print(C)
# Judge status: Wrong Answer
#第2問 ABC081A
s = input()
a = int(s.count('o'))
print(int(700+a*100))
# Judge status: Wrong Answer
s=input()
x,y=0,0
for i in s:
    if(i=='N'):
        y+=1
    elif(i=='S'):
        y-=1
    elif(i=='W'):
        x-=1
    else:
        x+=1
if(x==0 and y>=0):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
ans = 0
for i in range(m):
    ans += (1/2)*(a[i]+1)

print(ans)
# Judge status: Accepted
O = input()
E = input()
o = len(O)
e = len(E)
[print(O[i], E[i], sep = "", end = "") for i in range(min(o, e))]
print("" if o == e else O[-1])
# Judge status: Accepted
n=int(input())
w=[str(input()) for _ in range(n)]

if len(set(w))!=n:
    print("No")
    exit()

for i in range(n-1):
    if w[i][-1]!=w[i+1][0]:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
import numpy as np

def ForbiddenList():

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

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

    if len(NumB) != 0:
        result = list(range(min(NumB)-1, max(NumB)+2, 1))

        for data in NumB:
            result.remove(data)

        idx = np.abs(np.asarray(result) - NumA[0]).argmin()

        print(result[idx])

    else:
        print(NumA[0])
    

if __name__ == '__main__':
    ForbiddenList()
# Judge status: Wrong Answer
line = input()
line2 = input()
line3 = input()

print(line[-1])