import Data.List
main=do
 n<-getLine;a<-sort.map read.words<$>getLine
 (putStrLn.unwords.map show)(f(init a)(last a))
  where f [a] l = [l,a]
        f (x:y:a) l = if(abs(2*x-l))<(abs(2*y-l))then[l,x]else(f(y:a)l)