program lucydice;
{ constraints }
const
    MAXN = 100;

{ input data }
var
    N, i       : longint;
    A, B, C, D, valorepunteggio1, valorepunteggio2 : array[0..MAXN-1] of longint;
    W1, W2, X  : longint;

begin
{
    uncomment the following lines if you want to read/write from files
    assign(input,  'input.txt');  reset(input);
    assign(output, 'output.txt'); rewrite(output);
}

    { read N in the first line }
    readln(N);
    { read the four dice of each round }
    for i:=0 to N-1 do
             begin
                readln(A[i], B[i], C[i], D[i]);
                if A[i]>B[i] then valorepunteggio1[i]:=B[i]*10+A[i]
                             else if A[i]<B[i] then valorepunteggio1[i]:=A[i]*10+B[i]
                                               else if A[i]=B[i] then valorepunteggio1[i]:=A[i];
                if C[i]>D[i] then valorepunteggio2[i]:=D[i]*10+C[i]
                             else if C[i]<D[i] then valorepunteggio2[i]:=C[i]*10+D[i]
                                               else if C[i]=D[i] then valorepunteggio2[i]:=C[i];
             
             end;                                       

    W1 := 0; W2 := 0; X := 0;
     
    { insert your code here }
    for i:=0 to N-1 do
                begin
                  if (valorepunteggio1[i] div 10 >=1) and (valorepunteggio2[i] div 10 <1) then W2:=W2+1;
                  if (valorepunteggio2[i] div 10 >=1) and (valorepunteggio1[i] div 10 <1) then W1:=W1+1;
                  if (valorepunteggio1[i] div 10 <1) and (valorepunteggio2[i] div 10 <1) then if valorepunteggio1[i]>valorepunteggio2[i] then W1:=W1+1
                                                                                                                              else if valorepunteggio1[i]<valorepunteggio2[i] then W2:=W2+1
                                                                                                                                                                         else if valorepunteggio1[i]=valorepunteggio2[i] then X:=X+1;
                  if (valorepunteggio1[i] div 10 >=1) and (valorepunteggio2[i] div 10 >=1) then if valorepunteggio1[i]>valorepunteggio2[i] then W1:=W1+1
                                                                                                                              else if valorepunteggio1[i]<valorepunteggio2[i] then W2:=W2+1
                                                                                                                                                                         else if valorepunteggio1[i]=valorepunteggio2[i] then X:=X+1;                                                                                                                                                        
                end;
    { write the three results in a single line }
    writeln(W1, ' ', W2, ' ', X);
end.
