You're given an array of elements. For each element , determine the maximum length subarray such that is strictly the largest value.
Constraints
For all subtasks,
Subtask 1 [15%]
Subtask 2 [85%]
No additional constraints.
Input specification
The first line of input will contain .
The next line will contain space-separated integers .
Output specification
Output lines each containing integers. On the -th line, output the values of and for .
Sample Input
6
1 4 6 5 2 2
Sample Output
1 1
1 2
1 6
4 6
5 5
6 6
Comments