import sequtils,strutils var n = stdin.readline.parseInt A = stdin.readline.split.map(parseInt) m,M : int M = A[n-1] - A[0] m = int.high for i,a in A: if i == 0: continue m = min(m, a - A[i - 1]) echo m echo M