N = input() A = map(int, raw_input().split()) S = sum(A) / (N - 1) for x in range(51): for y in range(51): t = 2 * x + 4 * y if (t == S and x + y == N): print x,y