program Zadacha; {$APPTYPE CONSOLE} uses SysUtils; var i,j,l,m,n:integer; A:array[1..12] of integer; f1,f2:text; begin { TODO -oUser -cConsole Main : Insert code here } assign(f1,'matches.in'); assign(f2,'matches.out'); reset(f1); rewrite(f2); readln(f1,n); for l:=1 to n do begin for i:=1 to 12 do begin read(f1,A[i]); end; readln(f1); for i:=1 to 11 do begin for j:=i+1 to 12 do begin if A[i]>A[j] then begin m:=A[i]; A[i]:=A[j]; A[j]:=m; end; end; end; if (A[1]=A[4]) and (A[5]=A[8]) and (A[9]=A[12]) then writeln(f2,'yes') else writeln(f2,'no'); end; close(f1); close(f2); end.