Олимпиадный тренинг

Задача 33696. Second high


Задача

Темы: Циклы
Given N integers. Find the second largest element of the sequence (the element that would be the penultimate if the input data were sorted non-decreasingly)

Input:
the first line sets the number N (\(2<=N<=10^5\))
then there are N lines, one integer in each line
Output:
print the second maximum element

Examples
Input Output
1 7
10
15
20
35
14
35
10
35
2 5
10
5
7
11
9
10

Запрещенные операторы:max;min;[;sort