int input max for in range int input if max max max max max max elif m

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
n = int(input())
max = [0,0,0]
k = 0
for i in range(n):
x = int(input())
if x > max[0]:
max[2] = max[1]
max[1] = max[0]
max[0] = x
elif x > max[1]:
max[2] = max[1]
max[1] = x
elif x > max[2]:
max[2] = x
k = 1
if k == 0:
print('#')
else:
print(max[2])