import java.util.*; class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); int[] ar = new int[n]; int min = Integer.MAX_VALUE; for (int i=0; i 0) { min = Math.min(min, Math.abs(ar[i]-ar[i-1])); } } Arrays.sort(ar); System.out.println(min); System.out.println(ar[n-1]-ar[0]); } }