A:array[1..10] of integer; b, d:array[1..10] of string; c:array[1..10] of string; m, n, i, k, t :integer; begin for i:=1 to 10 do readln(a[i]); readln(b[i]); readln(c[i]); t:=1; for i:=1 to 10 do if (2014-a[i])>65 then begin d[t]:=b[i]; t:=t+1; end; for i:=1 to 10 do if c[i]='м' then m:=m+1 else n:=n+1; m:=m\10*100; n:=n\10*100; for i:=1 to t do writeln(d[i]); writeln(n); writeln(m); readln; end.