import sys sys.setrecursionlimit(100000000) MOD = 10 ** 9 + 7 INF = 10 ** 15 def main(): N = int(input()) A = list(map(int,input().split())) M = A[-1] - A[0] m = INF for i in range(N - 1): m = min(m,A[i + 1] - A[i]) print(m) print(M) if __name__ == '__main__': main()