const fi='songuyen.txt';
fo='gtln.txt';
var f, g: text;
max, x: longint;
i, j: byte;
begin
assign(f, fi);
reset(f);
assign(g, fo);
rewrite(g);
max:=minlongint;
for i:=1 to 5 do
for j:=1 to 4 do
begin
read(f, x);
if x>max then max:=x;
if j=4 then readln(f);
end;
write(g, max);
close(f);
close(g);
end.