if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
print(max([i for i in (arr) if i != max(arr)]))
Getting the max value, filtering it with if inside a for loop and getting the max value from the result will get you the runner-up value.