#include #define F(i,n) for(int i = 0;i < n;i++) #define N 1000001 int main(void){ int n,t,r=N; scanf("%d",&n); int a[n]; F(i,n)scanf("%d",&a[i]); //z(a,a,n); F(i,n){ if(i==n-1)break; t=a[i]-a[i+1]; if(t!=0){ if(t<0)t*=-1; if(r>t){ r=t; } } } if(r==N)r=0; printf("%d",r); return 0; }