import itertools
import sys

def rec(a, c, k, s):
  if (abs(c[0] - c[1]) > s) or (abs(c[2]-c[3]) > s):
    return
  if s == 0:
    if (c[0] == c[1]) and (c[2] == c[3]):
      r = c[0] * c[2] 
      if r > 0:
        global x, y
        x = min(x, r)
        y = max(y, r)
    return
  z = a[k]
  for i in range(4):
    c[i] += z
    rec(a, c, k + 1, s - z)
    c[i] -= z
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(reverse = True)
l = sum(a)
x, y = l * l + 1, 0
rec(a, [0] * 4, 0, l)
sys.stdout.write(f'{x} {y}\n')