import numpy as np

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

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

A = []



for n in range(102):

  if n not in P:

    A+=[abs(n-X)]

  else:

    A+=[100]



print((np.argmin(A)))
X,N = list(map(int,input().split()))

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



for n in range(51):

  if X-n not in P:

    print((X-n))

    break

  if X+n not in P:

    print((X+n))

    break
import numpy as np

X, N = list(map(int, input().split()))
P = list(map(int, input().split()))
A = []
for n in range(102):
    if n not in P:
        A += [abs(n - X)]
    else:
        A += [100]
print((np.argmin(A)))

X, N = list(map(int, input().split()))
P = list(map(int, input().split()))
for n in range(51):
    if X - n not in P:
        print((X - n))
        break
    if X + n not in P:
        print((X + n))
        break

-import numpy as np - -A = [] -for n in range(102): -    if n not in P: -        A += [abs(n - X)] -    else: -        A += [100] -print((np.argmin(A))) +for n in range(51): +    if X - n not in P: +        print((X - n)) +        break +    if X + n not in P: +        print((X + n)) +        break