import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for (int i = 0; i < N; ++i) { a[i] = sc.nextInt(); } long min = Long.MAX_VALUE / 3, max = -Long.MAX_VALUE / 3; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { if (i == j) continue; min = Math.min(min, Math.abs(a[i] - a[j])); max = Math.max(max, Math.abs(a[i] - a[j])); } } System.out.println(min); System.out.println(max); } }