#include "bits/stdc++.h" using namespace std; int main() { int N, X[100000], MIN = pow(10, 8); cin >> N; for (int i = 0; i < N; i++) { cin >> X[i]; } sort(X, X + N); for (int i = 1; i < N; i++) { if (X[i] != X[i - 1]) { MIN = min(MIN, X[i] - X[i - 1]); } } cout << MIN << endl; }