Module: Tasks for using the while loop


Problem

3 /9


Second highest in sequence

Problem

The sequence consists of different natural numbers and ends with the number 0. Determine the value of the second largest element in this sequence.

Input 
A sequence of natural numbers is entered, ending with the number 0 (the number 0 itself is not included in the sequence, but serves as a sign of its termination).

Imprint 
Output the answer to the problem
 

 

Examples
# Input Output
1 9
7
0
7