var
x,y,x1,y1,t:longint;
s:string;
begin
assign(input,'poj_1657.in');
assign(output,'poj_1657.out');
reset(input);
rewrite(output);
readln(t);
for t:=1 to t do
begin
readln(s);
x:=ord(s[1]);
y:=ord(s[2]);
x1:=ord(s[4]);
y1:=ord(s[5]);
{if (x=x1)and(y=y1) then write('0 0 0 0 ') else continue;}
if abs(x-x1)>abs(y-y1) then write(abs(x-x1),' ') else write(abs(y-y1),' ');
if (x=x1)and(y=y1) then write('0 ') else
if (abs(x-x1)=abs(y-y1))or(x=x1)or(y=y1) then write('1 ') else write('2 ');
if (x=x1)and(y=y1) then write('0 ') else
if (x=x1)or(y=y1) then write('1 ') else write('2 ');
if (x=x1)and(y=y1) then write('0 ') else
if abs(x-x1) mod 2=abs(y-y1) mod 2 then
if abs(x-x1)=abs(y-y1) then write('1 ') else write('2 ')
else write('Inf');
writeln;
end;
close(input);close(output);
end.