n = int(input()) a = list(map(int, input().split())) sum_a = sum(a) t = sum_a // (n - 1) # Check each a_i to ensure (t - a_i) is 2 or 4 # According to problem statement, the input guarantees this is valid for ai in a: assert (t - ai) in (2, 4) x = (4 * n - t) // 2 y = n - x print(x, y)