#include int main(void){ int n; scanf( "%d", &n ); int i, j; int x; int pos[n]; long min = 1000000; int d = 0; for( i = 0; i < n; i++ ){ scanf( "%d", &x ); pos[i] = x; } for( i = 0; i < n; i++ ){ for( j = i + 1; j < n; j++ ){ d = pos[i] - pos[j]; d = d < 0 ? d * -1 : d; if( d > 0 && d < min ){ min = d; } } } printf( "%d\n", min ); }