include [HTML_REMOVED]
using namespace std;
int num[100000];
int main() {
int n;
cin >> n;
int mind=1e9;
for (int i = 0; i < n; i) {
cin >> num[i];
}
sort(num,num+n);
for(int i=0;i<n-1;i){
mind=min(mind,num[i+1]-num[i]);
}
cout<<mind;
return 0;
}