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