Problem E. Successor
时间限制 1000 ms
内存限制 64 MB
Sean owns a company and he is the BOSS.The other Staff has one Superior.every staff has a loyalty and ability.Some times Sean will fire one staff.Then one of the fired man’s Subordinates will replace him whose ability is higher than him and has the highest loyalty for company.Sean want to know who will replace the fired man.
输入数据
输出数据
For every query print a number:the Serial number of whom would replace the losing job man,If there has no one to replace him,print -1.
样例输入
复制
1
3 2
0 100 99
1 101 100
1
2
样例输出
$ Mathjax font initiator $