Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    mina=100
    for i in range(min(p),max(p)):
        if i not in p:
            if mina>abs(i-x):
                mina=abs(i-x)
                ans=i
                if ans>x and (x-mina) not in p:
                    ans=x-mina
except:
    ans=x

print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    p.sort()
    min=abs(p[n-1])
    for i in range(p[0],p[n-1]):
        if i not in p:
            if min>abs(i-x):
                min=abs(i-x)
                ans=i
                if ans>x and x-min not in p:
                    ans-=min
except:
    ans=x

print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    p.sort()
    min=abs(p[n-1])
    for i in range(p[0]-2*x,p[n-1]):
        if i not in p:
            if min>abs(i-x):
                min=abs(i-x)
                ans=i
except:
    ans=x

print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    p.sort()
    min=abs(p[n-1])
    for i in range(p[0],p[n-1]):
        if i not in p:
            if min>abs(i-x):
                min=abs(i-x)
                ans=i
except:
    ans=x
print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    p.sort()
    min=abs(p[0])
    for i in range(p[n-1]):
        if i not in p:
            if min>abs(i-x):
                min=abs(i-x)
                ans=i
except:
    ans=x
print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
min=abs(p[0])
for i in range(p[n-1]):
    if i not in p:
        if min>abs(i-x):
            min=abs(i-x)
            ans=i
print(ans)

Fixed submission:
x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])