Program savez;
Type
sc=array [1..5000] of int64;
sc1=array [1..5000] of string;
Var
a,b:sc;
s:sc1;
i,j,n:longint;
min,temp,temp1:longint;
mins:string;
c:char;
Begin
assign(input,'savez.in');
assign(output,'savez.out');
reset(input);
rewrite(output);
n:=1;
while not(eof(input)) do begin
readln(a[n],b[n],c,s[n]);
n:=n+1;
end;
n:=n-1;
temp:=0;
for i:=2 to n do begin
temp1:=(b[1]-b[i])*a[i];
if temp1<0 then temp1:=temp1*(-1);
temp:=temp+temp1;
end;
min:=temp;
mins:=s[1];
for i:=2 to n do begin
temp:=0;
for j:=1 to (i-1) do begin
temp1:=(b[i]-b[j])*a[j];
if temp1<0 then temp1:=temp1*(-1);
temp:=temp+temp1;
end;
for j:=(i+1) to n do begin
temp1:=(b[i]-b[j])*a[j];
if temp1<0 then temp1:=temp1*(-1);
temp:=temp+temp1;
end;
if temp<min then begin
min:=temp;
mins:=s[i];
end;
end;
writeln(mins);
close(input);
close(output);
End.