import java.util.Arrays; import java.util.Scanner; public class N0_716 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); int[] aa = new int[N]; for (int i = 0; i < N; i++) { aa[i] = sc.nextInt(); } Arrays.sort(aa); int max = 0; int min = aa[1] - aa[0]; for(int i = 0; i < aa.length; i++) for(int y = i+1; y < aa.length; y++) { if(aa[y] - aa[i] > max) max = aa[y] - aa[i]; else if(aa[y] - aa[i] < min) min = aa[y] - aa[i]; } System.out.println(min); System.out.println(max); } }