r = [] n = int(input()) a = list(map(int,input().split())) for i in range(n): for j in range(n): if i != j: r.append(abs(a[i]-a[j])) print(min(r))