n = int(input()) sq = [int(i) for i in input().split()] a = sum(sq) k = (a - 2*(n**2) + 2*n)/(2*n-2) print(int(n-k),int(k))