output_description: Print a_i and a_j that you selected, with a space in between.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
      a_1 a_2 ... a_n
attempt: ###############################################################################
  
  from sys import stdout
  from bisect import bisect_left as binl
  from copy import copy, deepcopy
  from collections import defaultdict
  
  
  mod = 1
  
  
  def intin():
      input_tuple = input().split()
      if len(input_tuple) <= 1:
          return int(input_tuple[0])
      return tuple(map(int, input_tuple))
  
  
  def intina():
      return [int(i) for i in input().split()]
  
  
  def intinl(count):
      return [intin() for _ in range(count)]
  
  
  def modadd(x, y):
      global mod
      return (x + y) % mod
  
  
  def modmlt(x, y):
      global mod
      return (x * y) % mod
  
  
  def lcm(x, y):
      while y != 0:
          z = x % y
          x = y
          y = z
      return x
  
  
  def combination(x, y):
      assert x >= y
  
      if y > x // 2:
          y = x - y
  
      ret = 1
  
      for i in range(0, y):
          j = x - i
          i = i + 1
  
          ret = ret * j
          ret = ret // i
  
      return ret
  
  
  def get_divisors(x):
      retlist = []
      for i in range(1, int(x**0.5) + 3):
          if x % i == 0:
              retlist.append(i)
              retlist.append(x // i)
      return retlist
  
  
  def get_factors(x):
      retlist = []
      for i in range(2, int(x**0.5) + 3):
          while x % i == 0:
              retlist.append(i)
              x = x // i
      retlist.append(x)
      return retlist
  
  
  def make_linklist(xylist):
      linklist = {}
      for a, b in xylist:
          linklist.setdefault(a, [])
          linklist.setdefault(b, [])
          linklist[a].append(b)
          linklist[b].append(a)
      return linklist
  
  
  def calc_longest_distance(linklist, v=1):
      distance_list = {}
      distance_count = 0
      distance = 0
      vlist_previous = []
      vlist = [v]
      nodecount = len(linklist)
  
      while distance_count < nodecount:
          vlist_next = []
          for v in vlist:
              distance_list[v] = distance
              distance_count += 1
              vlist_next.extend(linklist[v])
          distance += 1
          vlist_to_del = vlist_previous
          vlist_previous = vlist
          vlist = list(set(vlist_next) - set(vlist_to_del))
  
      max_distance = -1
      max_v = None
      for v, distance in distance_list.items():
          if distance > max_distance:
              max_distance = distance
              max_v = v
  
      return (max_distance, max_v)
  
  
  def calc_tree_diameter(linklist, v=1):
      _, u = calc_longest_distance(linklist, v)
      distance, _ = calc_longest_distance(linklist, u)
      return distance
  
  
  class UnionFind:
  
      def __init__(self, n):
          self.parent = [i for i in range(n)]
  
      def root(self, i):
          if self.parent[i] == i:
              return i
          self.parent[i] = self.root(self.parent[i])
          return self.parent[i]
  
      def unite(self, i, j):
          rooti = self.root(i)
          rootj = self.root(j)
          if rooti == rootj:
              return
          if rooti < rootj:
              self.parent[rootj] = rooti
          else:
              self.parent[rooti] = rootj
  
      def same(self, i, j):
          return self.root(i) == self.root(j)
  
  
  ###############################################################################
  
  
  def main():
      n = intin()
      alist = intina()
  
      alist.sort()
  
      m = alist[-1]
  
      ind = binl(alist, m // 2)
      ind1 = ind - 1 if ind > 0 else None
      ind2 = ind
  
      mmlist = [m // 2]
      if m & 1:
          mmlist.append(m // 2 + 1)
  
      c1 = float("inf")
      if ind1 is not None and ind1 != len(alist) - 1:
          for mm in mmlist:
              c1 = min(c1, abs(alist[ind1] - mm))
  
      c2 = float("inf")
      if ind2 != len(alist) - 1:
          for mm in mmlist:
              c2 = min(c2, abs(alist[ind2] - mm))
  
      if c1 < c2:
          print("%d %d" % (m, alist[ind1]))
      else:
          print("%d %d" % (m, alist[ind2]))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Let {\rm comb}(n,r) be the number of ways to choose r objects from among n
  objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n,
  select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If
  there are multiple pairs that maximize the value, any of them is accepted.
samples: [{"input": "5\n    6 9 4 2 11", "output": "11 6\n    \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n  * \\rm{comb}(4,2)=6\n  * \\rm{comb}(6,2)=15\n  * \\rm{comb}(6,4)=15\n  * \\rm{comb}(9,2)=36\n  * \\rm{comb}(9,4)=126\n  * \\rm{comb}(9,6)=84\n  * \\rm{comb}(11,2)=55\n  * \\rm{comb}(11,4)=330\n  * \\rm{comb}(11,6)=462\n  * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n    100 0", "output": "100 0"}]