Leaders In An Array
easy
Given an array A of positive integers. Your task is to find the leaders in the array. An element of array is leader if it is greater than or equal to all the elements to its right side. The rightmost element is always a leader.
Constraints
1 <= n <= 10^7 0 <= Ai <= 10^7
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
6
16 17 4 3 5 2
Sample Output
17 5 2