Given an array, print the Next Greater Element for every element.
The Next Greater Element for an element x is the first greater element on the right side of x in the array. Elements for which no greater element exist, consider the next greater element as −1.
The first line contains number n(n≤105). The second line contains n positive integers, each not greater than 109.
For each element of input array print the Next Greater Element.