#include using namespace std; signed main(){ int N; cin >> N; vector< int > X( N ); for( int i = 0; i < N; ++i ) cin >> X[ i ]; sort( X.begin(), X.end() ); X.erase( unique( X.begin(), X.end() ), X.end() ); int ans = ( int ) 1e9; for( int i = 1; i < X.size(); ++i ) ans = min( ans, X[ i ] - X[ i - 1 ] ); cout << ans << endl; return 0; }