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