import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // int[] a = new int[n]; // ArrayList=new ArrayList(n); PriorityQueue queue = new PriorityQueue(n); for(int a_i=0; a_i < n; a_i++){ queue.add(in.nextInt()); // a[a_i] = in.nextInt(); } long element; long last = queue.remove(); long difference = Long.MAX_VALUE; while(!queue.isEmpty()) { element = queue.remove(); if(element-last