perl -e 'print pop @{[map {$l = $_ if (length($l) < length($_)); $l} (<>)]};' file