n=int(input()) a=[*map(int,input().split())] ans=[] for i in range(n): for j in range(i+1,n): ans.append(abs(a[i]-a[j])) print(min(ans),max(ans),sep='\n')