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: def fact(i):
      a = 1
      for i in range(2,i+1):
          a *= i
      return a
  def comb(i,j):
      if j != 0 and j != i
          return int(fact(i)/(fact(j)*fact(i-j)))
      else:
          return 1
  
  n = int(input())
  l = list(map(int,input().split()))
  l.sort()
  a = []
  b = []
  d = []
  for i in range(1,n):
      c = l[i]
      if l[0] >= int((c+1)/2):
          a.append(comb(c,l[0]))
          b.append(c)
          d.append(l[0])
      else:
          j = 0
          while l[j] < int((c+1)/2):
              j += 1
          else:
              if l[j] == int((c+1)/2):
                  a.append(comb(c,int((c+1)/2)))
                  b.append(c)
                  d.append(int((c+1)/2))
              else:
                  if l[j] - int((c+1)/2) < int((c+1)/2) -l[j-1]:
                      a.append(comb(c,l[j]))
                      b.append(c)
                      d.append(l[j])
                  else:
                      a.append(comb(c,l[j-1]))
                      b.append(c)
                      d.append(l[j-1])
  I = a.index(max(a))
  print("{} {}".format(b[I],d[I]))
  
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"}]