n=int(input()) a=list(map(int,input().split())) x=sum(a)//(n-1) print((4*n-x)//2,(x-2*n)//2)