var input :text; name, s, NameInFile, number :string; i, space1, space2 :integer; begin readln(name); assign(input,'input.txt'); reset(input); while not Eof(input) do begin readln(input,s); space1:= pos(' ',s); for i:= 1 to length(s) do if (s[i] = ' ') then begin space2:= i; if space2 <> space1 then break; end; NameInFile:= copy(s,pos(' ',s)+1,space2-space1-1); number:= copy(s,space2+1,length(s)); if NameInFile = name then writeln(number); end; close(input); end.