n = int(input()) ls = list(map(int,input().split())) ls.sort() c = ls[1]-ls[0] for i in range(n-1): if c > ls[i+1] - ls[i]: c = ls[i+1] - ls[i] print(c) print(ls[-1]-ls[0])