#coding:utf-8 from math import fabs N=input() X=map(int,raw_input().split()) X.sort() s=[] for i in range(N): if i==len(X)-1: break else: s.append(int(fabs(X[i]-X[i+1]))) s.sort() if len(set(s))==1: print 0 else: for i in s: if i!=0: print i break