import java.util.;
import java.lang.;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int size = Integer.parseInt(br.readLine());
int i,scoreA=0,scoreB=0,lead=0,playerName=1;
for (i=0;i<size;i++){
String []x = br.readLine().split(" ");
scoreA += Integer.parseInt(x[0]);
scoreB += Integer.parseInt(x[1]);
if(scoreA>scoreB){
if(lead<(scoreA-scoreB)){
lead = scoreA-scoreB;
playerName = 1;
}
}
else{
if(lead<(scoreA-scoreB)){
lead = scoreB-scoreA;
playerName = 2;
}
}
}
System.out.println(playerName+" "+lead);
}
}
it is giving error in line where size is intailized