Guffy dreams of becoming the King of Pirates. To do that, he must choose which torrent to download first from a list published by the ICPC.
Each torrent i has:
S_i: number of seedsP_i: number of peersGuffy wants the torrent with the highest number of seeds. If there is a tie, he chooses the one with the lowest number of peers.
N (0 < N <= 10^4), the number of torrents.N lines, each with two integers S_i and P_i (0 <= S_i <= 10^4, 0 <= P_i <= 10^4).Torrents are numbered from 1 to N in input order.
Print one integer: the index of the torrent Guffy should download first.
If there is still a tie (same seeds and same peers), any tied index is valid.
Input:
3
2 5
4 0
5 10
Output:
3