n = int(input()) list1 = list(map(int, input().split())) for i in range(n): low = 0 high = 0 for j in range(n): if list1[j] > list1[i]: high = high + 1 if list1[j] < list1[i]: low = low + 1 if low == high: print(list1[i]) exit(0) print(-1)
11-23
1596
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-12
809
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31