import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] x = new int[n]; for (int i = 0; i < n; i++) { x[i] = sc.nextInt(); } int first = x[0]; //int i = 1; int min = Integer.MAX_VALUE; for (int i = 1; i < n; i++) { int second = x[i]; if (Math.abs(first - second) < min && Math.abs(first - second) != 0) { min = Math.abs(first - second); } first = second; } System.out.println(min); } }