1497 -- S Number
Time Limit :1000 MS Memory Limit :65536 KB
Accepts : 88 Submits : 196
User Accepts : 81 User Submits : 87
<Submit>   <Statistics>   <Discuss>

Description

You are given a set of numbers. The number which is only less than the largest number is called as S-Number. For the number set which contains 8 numbers: 3, 6, 0, -5, 7, 7, 6, 2. The largest number is 7. So the S-Number is 6 because it is only less than 7.

Input

The first line of each case contains a positive integer n that indicates the size of the set. Then n numbers followed, denotes the numbers in the set. The input is terminated by a single line n = 0. All the numbers in the input will be less than 100.

Output

One line contains the S-Number for each case.

Sample Input

8
3 6 0 -5 7 7 6 2
0

Sample Output

6

 

Source

Tianjing Univ. Campus Contest 2007
<Submit>   <Statistics>   <Discuss>
 


Powered by Zhang Zhaoning PDL College of Computer
Since 2006.03.09 | 2007.11.22 | 2010.03.02 Copyright (r) 2006 - 2010 All Rights Reserved