#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define minimize(a, x) a = std::min(a, x) #define maximize(a, x) a = std::max(a, x) typedef long long ll; int const inf = 1<<29; int main() { int N; cin >> N; vector X(N); rep(i, N) cin >> X[i]; sort(all(X)); X.erase(unique(all(X)), X.end()); int min = 114514810; REP(i, 1, X.size()) { minimize(min, X[i]-X[i-1]); } cout << min << endl; return 0; }