import itertools
import sys

def rec(a, c, k):
  if k == len(a):
    if (c[0] == c[1]) and (c[2] == c[3]):
      global x, y
      r = c[0] * c[2] 
      if r > 0:
        x = min(x, r)
        y = max(y, r)
    return
  for i in range(4):
    c[i] += a[k]
    rec(a, c, k + 1)
    c[i] -= a[k]
it = iter([i for s in map(str.split, sys.stdin.readlines()) for i in map(int, s)])
n = next(it)
_a = list(itertools.islice(it, n))
a = _a * 2
a.sort()
l = sum(a)
x, y = l * l + 1, 0
rec(a, [0] * 4, 0)
sys.stdout.write(f'{x} {y}\n')
