n = int(input()) p = sum(map(int, input().split())) // (n - 1) // 2 % n print(n - p, p)