fork download
  1. program paradox;
  2. var n, i, count:integer;
  3. S: array[1..325] of string;
  4. A,B,SY: array [1..325] of char;
  5. lettere : array[1..26] of integer;
  6. risposta: string;
  7. begin
  8. readln(N);
  9. for i:=1 to N do readln(S[i]);
  10. for i:=1 to N do begin A[i]:=S[i][1]; SY[i]:=S[i][3]; B[i]:=S[i][5];end;
  11. for i:=1 to 26 do lettere[i]:=0;
  12. for i:=1 to N do begin if SY[i]='<' then lettere[ord(A[i])-96]:=lettere[ord(A[i])-96]+1
  13. else lettere[ord(B[i])-96]:=lettere[ord(B[i])-96]+1; end;
  14. risposta:=':('; count:=0;
  15. for i:=1 to 26 do if lettere[i]=2 then count:=count+1;
  16. for i:=1 to 26 do writeln (lettere[i]);
  17. if count mod 2 =0 then risposta:=':)';
  18. writeln(risposta);
  19. end.
Success #stdin #stdout 0.01s 5284KB
stdin
7
a > f
b > c
a < d
d < c
f < b
d < e
e < b
stdout
1
0
1
2
1
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
:)