n = int(input()) m = sorted(map(int,input().split())) b = max(m) for i in range(n): a=m[i]-m[i-1] if 0<=a>=b: b=a print(b)