import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int []a = new int[N]; for(int i = 0; i < N; i++) { a[i] = scan.nextInt(); } scan.close(); int max = a[N - 1] - a[0]; int min = Integer.MAX_VALUE; for(int i = 0; i < N - 1; i++) { if(min > a[i + 1] - a[i]) { min = a[i + 1] - a[i]; } } System.out.println(min); System.out.println(max); } }