Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(1,len(b)):
  if x <= b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      exit(0)
    else:
      print(b[i])
      exit(0)
print(b[-1])


Fixed submission:
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])

Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(len(b)):
  if x <= b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      exit(0)
    else:
      print(b[i])
      exit(0)
print(b[-1])

Fixed submission:
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])

Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(len(b)):
  if x <= b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      exit(0)
    else:
      print(b[i])
      exit(0)
print(x-b[-1])

Fixed submission:
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])

Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(len(b)):
  if x < b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      exit(0)
    else:
      print(b[i])
      exit(0)
print(x-b[-1])

Fixed submission:
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])

Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(len(b)):
  if x < b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      break
    else:
      print(b[i])
      break
print(x-b[-1])

Fixed submission:
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])