uses crt;
var a,b,c,p,q,r,s,u,v:longint;
begin
clrscr;
write('p:q , r:s , u:v=');readln(p,q,r,s,u,v);
if p>q then inc(a,3)
else if p<q then inc(b,3) else begin inc(a); inc(b); end;
if r>s then inc(b,3)
else if r<s then inc(c,3) else begin inc(b); inc(c); end;
if u>v then inc(a,3)
else if u<v then inc(c,3) else begin inc(a); inc(c); end;
writeln(a,' ',b,' ',c);
readln;
end.