package P135; import java.io.*; import java.util.Arrays; import java.util.Scanner; public class P135 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.nextLine(); int nint = Integer.parseInt(n); String l = sc.nextLine(); String[] lstrs = l.split(" "); int lint[] = new int[nint]; int i = 0; int max = nint - 1; for (i=0;i<=max;i++) { lint[i] = Integer.parseInt(lstrs[i]); } int j; int temp = 0; int ans = 1000000; Arrays.sort(lint); for (i=1;i<=max;i++) { temp = Math.abs(lint[i-1] - lint[i]); if (ans > temp && lint[i] != lint[i-1]) { ans = temp; } } System.out.println(ans); } }