#include using namespace std; #define REP(i,n) for(int i=0; i<(n); i++) struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { int N; cin >> N; vector vc(N); for( auto&& x : vc ) { cin >> x; } sort( vc.begin(), vc.end() ); vector res; REP( i, N - 1 ) { if( vc[ i + 1 ] - vc[ i ] != 0 ) { res.push_back( abs( vc[ i + 1 ] - vc[ i ] ) ); } } cout << ( res.size() == 0 ? 0 :*min_element( res.begin(), res.end() ) ) << endl; return 0; }