fun main(args: Array<String>) {
    val n = readInt()
    val a = readIntList().sorted()
    val r = a.last() / 2.0
    var prev = a[a.lastIndex - 1]
    for (i in n - 3 downTo 1) {
        if (Math.abs(a[i] - r) > Math.abs(prev - r)) {
            println("${a.last()} $prev")
            return
        } else {
            prev = a[i]
        }
    }
    println("${a.last()} ${a[0]}")
}

fun printYesOrNo(flag: Boolean) {
    println(if (flag) "YES" else "NO")
}

fun readIntList(): List<Int> = readLine()!!.split(' ').map { it.toInt() }

fun readInt(): Int = readLine()!!.toInt()

fun err(print: Any) {
    System.err.println(print)
}