n = int(input()) aa = list(map(int,input().split())) bb = sorted(list(set(aa))) max_num = bb[-1]-bb[0] min_num = [] for i in range(len(aa)-1): min_num.append(aa[i+1]-aa[i]) print(max_num,min(min_num) ,sep = "\n")