
n = int(input())  # the number of temperatures to analyse
temps = input()  # the n temperatures expressed as integers ranging from -273 to 5526

temps = temps.split(' ')
m = -1000000
mi = '0'
if n == 0:
    pass
else:
    for i in temps:
        if 0 - abs(int(i)) > m:
            mi = i
            m = 0 - abs(int(i))
        elif 0 - abs(int(i)) == m:
            if int(i) < 0:
                pass
            else:
                mi = i
print(mi)


f091be7e2f33000867761dba4fe0e20112257e7b
<mask token>

<mask token>
if n == 0:
    pass
else:
    for i in temps:
        if 0 - abs(int(i)) > m:
            mi = i
            m = 0 - abs(int(i))
        elif 0 - abs(int(i)) == m:
            if int(i) < 0:
                pass
            else:
                mi = i
print(mi)

n = int(input())
temps = input()
temps = temps.split(' ')
m = -1000000
mi = '0'
if n == 0:
    pass
else:
    for i in temps:
        if 0 - abs(int(i)) > m:
            mi = i
            m = 0 - abs(int(i))
        elif 0 - abs(int(i)) == m:
            if int(i) < 0:
                pass
            else:
                mi = i
print(mi)


n = int(input())  # the number of temperatures to analyse
temps = input()  # the n temperatures expressed as integers ranging from -273 to 5526

temps = temps.split(' ')
m = -1000000
mi = '0'
if n == 0:
    pass
else:
    for i in temps:
        if 0 - abs(int(i)) > m:
            mi = i
            m = 0 - abs(int(i))
        elif 0 - abs(int(i)) == m:
            if int(i) < 0:
                pass
            else:
                mi = i
print(mi)

