Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

min = x
max = x

if n == 0:
    print(x)
else:
    for i in range(10000):

        min -= 1
        max += 1

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()

min = x
max = x

if n == 0:
    print(x)
else:
    for i in range(10000):

        min -= 1
        max += 1

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1

    if min not in arr:
        print(min)
        break

    if max not in arr:
        print(max)
        break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1

    if min not in arr:
        print(min)
        break

    if max not in arr:
        print(max)
        break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1
    
    try:
        arr.index(min)
    except:
        print(min)
        break

    try:
        arr.index(max)
    except:
        print(max)
        break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(100):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1
    
    try:
        arr.index(min)
    except:
        print(min)
        break

    try:
        arr.index(max)
    except:
        print(max)
        break

Fixed submission:
x,n = map(int,input().split())

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break