Problem1513--支撑数

1513: 支撑数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

给出一系列整数,输出所有的“支撑数”。支撑数是这样一种数:它不在第一个,也不在最后一个,而且比左边和右边相邻的数都大。

Input

第一行1个整数n,表示数的个数,3<=n<=100。

第二行n个整数,每两个数之间用一个空格隔开。

Output

按读入顺序,一次输出一行若干个支撑数,每两个数之间用一个空格隔开。

Sample Input Copy

14
1 3 2 4 1 5 3 9 7 10 8 23 85 43

Sample Output Copy

3 4 5 9 10 85

Source/Category