m@main=getLine>>=putStrLn.f>>m;f s=foldr1(([max,min]<*s)!!13)$words s