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