import java.util.Scanner;
public class 방향전환 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int tc=1;tc<=T;tc++) {
int x1=sc.nextInt();
int y1=sc.nextInt();
int x2=sc.nextInt();
int y2=sc.nextInt();
int dx = Math.abs(x2-x1);
int dy = Math.abs(y2-y1);
int result=0;
if((dx+dy)%2==0) {
result = Math.max(dx, dy)*2;
}else {
result = Math.max(dx, dy)*2-1;
}
System.out.println("#"+tc+" " + result);
}
}
}