## Algorithm

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Very soon there will be a parade of victory over alien invaders in Berland. Unfortunately, all soldiers died in the war and now the army consists of entirely new recruits, many of whom do not even know from which leg they should begin to march. The civilian population also poorly understands from which leg recruits begin to march, so it is only important how many soldiers march in step.

There will be n columns participating in the parade, the i-th column consists of li soldiers, who start to march from left leg, and ri soldiers, who start to march from right leg.

The beauty of the parade is calculated by the following formula: if L is the total number of soldiers on the parade who start to march from the left leg, and R is the total number of soldiers on the parade who start to march from the right leg, so the beauty will equal |L - R|.

No more than once you can choose one column and tell all the soldiers in this column to switch starting leg, i.e. everyone in this columns who starts the march from left leg will now start it from right leg, and vice versa. Formally, you can pick no more than one index i and swap values li and ri.

Find the index of the column, such that switching the starting leg for soldiers in it will maximize the the beauty of the parade, or determine, that no such operation can increase the current beauty.

Input

The first line contains single integer n (1 ≤ n ≤ 105) — the number of columns.

The next n lines contain the pairs of integers li and ri (1 ≤ li, ri ≤ 500) — the number of soldiers in the i-th column which start to march from the left or the right leg respectively.

Output

Print single integer k — the number of the column in which soldiers need to change the leg from which they start to march, or 0 if the maximum beauty is already reached.

Consider that columns are numbered from 1 to n in the order they are given in the input data.

If there are several answers, print any of them.

Examples
input
Copy
`35 68 910 3`
output
Copy
`3`
input
Copy
`26 55 6`
output
Copy
`1`
input
Copy
`65 91 34 84 523 5412 32`
output
Copy
`0`
Note

In the first example if you don't give the order to change the leg, the number of soldiers, who start to march from the left leg, would equal 5 + 8 + 10 = 23, and from the right leg — 6 + 9 + 3 = 18. In this case the beauty of the parade will equal |23 - 18| = 5.

If you give the order to change the leg to the third column, so the number of soldiers, who march from the left leg, will equal 5 + 8 + 3 = 16, and who march from the right leg — 6 + 9 + 10 = 25. In this case the beauty equals |16 - 25| = 9.

It is impossible to reach greater beauty by giving another orders. Thus, the maximum beauty that can be achieved is 9.

## Code Examples

### #1 Code Example with C++ Programming

```Code - C++ Programming```

``````#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

vector<int> l;
vector<int> r;
int res = 0, best = 0, index = 0;

int main() {
int n;
cin >> n;

int total1= 0, total2 = 0;
for(int i = 0; i < n; i++) {
int tmp1, tmp2;

cin >> tmp1 >> tmp2;
total1 += tmp1;
total2 += tmp2;

l.push_back(tmp1);
r.push_back(tmp2);
}
res = total1 - total2;
best = abs(res);

for(int i =  1; i <= n; i++) {
total1 = total1 - l[i-1] + r[i-1];
total2 = total2 - r[i-1] + l[i-1];

res = total1 - total2;
if(best < abs(res)) {
index = i;
best = abs(res);
}

total1 = total1 + l[i-1] - r[i-1];
total2 = total2 + r[i-1] - l[i-1];
}

cout << index << endl;

return 0;
}``````
Copy The Code &

Input

cmd
3 5 6 8 9 10 3

Output

cmd
3