$s.=chop while$_=(sort map{$|=print$s.$_|0 x10,$/;$_=<>.$_;/u/?exit:$_}0..9)[9]