Next greater Element#11456

Next greater Element

1 second
128 megabytes
Easy

An array of integers is given. For each element, you need to find the next greater element — the first element to the right that is strictly greater than the current one.

If there is no next greater element for a particular item, print .

Input

The first line contains a positive integer n~(n \le 10^5).

The second line contains positive integers, each not exceeding 10^9.

Output

For each element of the input array, print its next greater element. If there is none, print .

Examples

Example 1

Loading
Loading