Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
lis=[i+1 for i in range(100)]
flag=True
flag2=True
if n==0:
  flag=False
  print(x)


if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  if x>lis[-1]:
    print(lis[-1])
    flag2=False
  if flag2:
    for i in range(len(lis)):
      if lis[i]>x:
        id=i
        break
    if id>=1:
      if abs(x-lis[id])<abs(x-lis[id-1]):
        print(lis[id])
      else:
        print(lis[id-1])
    else:
      print(lis[0])

Fixed submission:
x,n=map(int,input().split())
lis=[i-1 for i in range(103)]
flag=True
if n==0:
  flag=False
  print(x)

if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  #print(lis)
  for i in range(len(lis)):
    if lis[i]>x:
      index=i
      break
  if abs(x-lis[index])<abs(x-lis[index-1]):
    print(lis[index])
  else:
    print(lis[index-1])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
lis=[i+1 for i in range(100)]
flag=True
flag2=True
if n==0:
  flag=False
  print(x)


if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  if x>lis[-1]:
    print(lis[-1])
    flag2=False
  if flag2:
    for i in range(len(lis)):
      if lis[i]>x:
        id=i
        break
    if id>=1:
      if abs(x-lis[id])<abs(x-lis[id-1]):
        print(lis[id])
      else:
        print(lis[id-1])
    else:
      print(lis[0])x,n=map(int,input().split())
lis=[i+1 for i in range(100)]
flag=True
flag2=True
if n==0:
  flag=False
  print(x)


if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  if x>lis[-1]:
    print(lis[-1])
    flag2=False
  if flag2:
    for i in range(len(lis)):
      if lis[i]>x:
        id=i
        break
    if id>=1:
      if abs(x-lis[id])<abs(x-lis[id-1]):
        print(lis[id])
      else:
        print(lis[id-1])
    else:
      print(lis[0])

Fixed submission:
x,n=map(int,input().split())
lis=[i-1 for i in range(103)]
flag=True
if n==0:
  flag=False
  print(x)

if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  #print(lis)
  for i in range(len(lis)):
    if lis[i]>x:
      index=i
      break
  if abs(x-lis[index])<abs(x-lis[index-1]):
    print(lis[index])
  else:
    print(lis[index-1])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
lis=[i+1 for i in range(100)]
flag=True
if n==0:
  flag=False
  print(x)
if x==100:
  p=list(map(int,input().split()))
  print(100)
  flag=False

if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  for i in range(len(lis)):
    if lis[i]>x:
      id=i
      break
  if id>=1:
    if abs(x-lis[id])<abs(x-lis[id-1]):
      print(lis[id])
    else:
      print(lis[id-1])
  else:
    print(lis[0])

Fixed submission:
x,n=map(int,input().split())
lis=[i-1 for i in range(103)]
flag=True
if n==0:
  flag=False
  print(x)

if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  #print(lis)
  for i in range(len(lis)):
    if lis[i]>x:
      index=i
      break
  if abs(x-lis[index])<abs(x-lis[index-1]):
    print(lis[index])
  else:
    print(lis[index-1])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
lis=[i+1 for i in range(100)]
flag=True
if n==0:
  flag=False
  print(x)
if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  for i in range(len(lis)):
    if lis[i]>x:
      id=i
      break
  if id>=1:
    if abs(x-lis[id])<abs(x-lis[id-1]):
      print(lis[id])
    else:
      print(lis[id-1])
  else:
    print(lis[0])

Fixed submission:
x,n=map(int,input().split())
lis=[i-1 for i in range(103)]
flag=True
if n==0:
  flag=False
  print(x)

if flag:
  p=list(map(int,input().split()))
  for i in p:
    lis.remove(i)
  #print(lis)
  for i in range(len(lis)):
    if lis[i]>x:
      index=i
      break
  if abs(x-lis[index])<abs(x-lis[index-1]):
    print(lis[index])
  else:
    print(lis[index-1])