import java.util.Scanner; class No_135 { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); int num = stdIn.nextInt(); int vc[] = new int[num]; for (int i = 0; i < num; i++) { vc[i] = stdIn.nextInt(); } System.out.println(vc_Length(vc, num)); } public static int vc_Length(int vc[], int num) { int tmp = 1000000; for (int k = 0; k < num - 1; k++) { if (tmp >= Math.abs(vc[k] - vc[k+1])) { if ( vc[k] == vc[k+1] ) { continue; } tmp = Math.abs(vc[k] - vc[k+1]); } } return tmp; } }