program pil_15_61(input1, output);
var
	f : text;
        minnum : integer;

function FindMinStr(var f : text) : integer;
var
	curlen, minlen : integer;
	MinStrNum, CurStrNum : integer;
	cur : char;
begin
	reset(f);
	curlen := 0;
	while not eoln(f) do begin
		read(f, cur);
		curlen := curlen + 1;
	end;
	minlen := curlen;
	MinStrNum := 1;
	CurStrNum := 1;

	while not eof(f) do begin
		curlen := 0;
		CurStrNum := CurStrNum + 1;
                ReadLn(f);
		while not eoln(f) do begin
			read(f, cur);
			curlen := curlen + 1;
		end;
		if curlen<minlen then begin
			MinStrNum := CurStrNum;
			minlen := curlen;
		end;
	end;
	FindMinStr := MinStrNum;
end;

procedure PrintStrNum(var f : text; n : integer);
var
	i : integer;
	cur : char;
begin
	reset(f);
	for i:=1 to n-1 do ReadLn(f);
	while not eoln(f) do begin
		read(f, cur);
		write(cur);
	end;
	WriteLn;
end;

begin
	assign(f, 'input1');
        minnum := FindMinStr(f);
	PrintStrNum(f, minnum);
	close(f);
end.