#K88937. Second Highest Number

    ID: 37419 Type: Default 1000ms 256MiB

Second Highest Number

Second Highest Number

Given a list of n integers, your task is to find the second highest number in the list. It is guaranteed that the list contains at least two distinct elements. Formally, if the list is denoted as \(a_1, a_2, \ldots, a_n\) with \(n \ge 2\) and there exist indices \(i\) and \(j\) such that \(a_i \neq a_j\), you should output the second largest number encountered.

Note: The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).

inputFormat

The first line of input contains a single integer \(n\) representing the number of elements. The second line contains \(n\) space-separated integers.

outputFormat

Output a single integer which is the second highest number from the list.

## sample
5
1 2 3 4 5
4