James and Edward are playing a game! They lay out
However, since Edward is just too good due to his massive brain, James has decided that Jessica will choose the breaking point, and they will see who is faster at choosing the maximum element on their respective side. Also, just for insurance, he has asked you to make a program that will tell him which card he and Edward will choose, help James!
Note: Both Edward and James may not choose the breaking point as their chosen card. In addition, if there are ties, break them by choosing the card with index that is the
Input Specification
First line, two integers
Second line,
Next
Output Specification
For each query, output 2 space separated integers, the index of the card that James and Edward will choose respectively, given that they both will try their best to win.
Constraints
For all subtasks:
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Sample Input 1
5 2
1 2 3 4 -5
3
4
Sample Output 1
2 4
3 5
Sample Explanation 1
For the first query, Jessica chooses index
For the second query, Jessica chooses index
Sample Input 2
5 2
2 2 2 6 6
3
4
Sample Output 2
1 5
1 5
Sample Explanation 2
For the first query,
The second query is a similar case.
Comments