var f: text; max, m, arv, r: integer; n, s: string; begin assign(f, 'yl2.dat'); reset(f); readln(f,s); max:=0; while not eof(f) do begin readln(f, s); val(s, m, arv); if arv <> 0 then continue else begin if (m>max) then max:=m; end; end; reset(f); readln(f, s); while not eof(f) do begin readln(f, s); readln(f, n); val(n, r, arv); if r=max then writeln(s); end; close(f); end.