1./**
* Angewandte Mathematik, SS11
* Problem: 10642-Can You Solve It?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1583
*
* @author Wolff, Marco
* @author Weber, Christian
* @author Waldleitner, Christoph
* @version 1.0, 05/02/2011
*
* Method : Ad Hoc
* Status : Accepted
* Runtime: 0.192
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {

public static void main(String[] args) {

int n = 0, srcX = 0, srcY = 0, tarX = 0, tarY = 0, cnt = 0;
String input = "";
StringTokenizer coors;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

try {
input = br.readLine();
n = Integer.parseInt(input);
} catch(IOException e) { e.getMessage(); }

for(int i = 0; i < n && i < 500; i++) {
cnt = i + 1;
try {
input = br.readLine();
} catch(IOException e) { e.getMessage(); }

coors = new StringTokenizer(input);

if(coors.countTokens() == 4) {
srcX = Integer.parseInt(coors.nextToken());
srcY = Integer.parseInt(coors.nextToken());
tarX = Integer.parseInt(coors.nextToken());
tarY = Integer.parseInt(coors.nextToken());
if((srcX > 100000) || (srcY > 100000) || (tarX > 100000) || (tarY > 100000)) {
continue;
}
}
else {
continue;
}

System.out.println("Case " + cnt + ": " + walkTheLine(srcX, srcY, tarX, tarY));
}
}

public static long walkTheLine(int sx, int sy, int tx, int ty) {
long steps = (long)(((((1+(tx+ty))*(tx+ty)) * 0.5) + tx) - ((((1+(sx+sy))*(sx+sy)) * 0.5) + sx));
if(steps < 0) {
steps *= -1;
}
return steps;
}
}