import Data.List
import qualified Data.ByteString.Char8 as B

main = do
    n<-readLn::IO Int
    as<-sort.unfoldr (B.readInt.B.dropWhile(==' '))<$>B.getLine::IO[Int]
    --
    putStrLn.unwords.map show $ solve n as

solve _ [a,b] = [b,a]
solve n as =
    if abs (half - fromIntegral a1) < abs (half - fromIntegral a2)
        then [al, a1]
        else [al, a2]
    where
        (ai, al:_) = splitAt (n-1) as
        half = fromIntegral al / 2.0
        (ale', a1:_) = partition (\a-> fromIntegral a <= half) ai
        a2 = last ale'
