#include

#include

#include

using namespace std;

int main()

{

int n,arr[10000],brr[10000],i,max=0,diff,l;

cin>>n;

for(i=0;i<n;i++)

{

cin>>arr[i];

cin>>brr[i];

}

for(i=0;i<n;i++)

{

if(arr[i]>brr[i])

{

diff=arr[i]-brr[i];

if(diff>max)

{

max=diff;

l=1;

}

```
}
else if(arr[i]<brr[i])
{
diff=brr[i]-arr[i];
if(diff>max)
{
max=diff;
l=2;
}
}
}
cout<<l<<" "<<max;
```

return 0;}