package main import ( "bufio" "fmt" "os" "strconv" ) func nextInt(sc *bufio.Scanner) int { sc.Scan() t, _ := strconv.Atoi(sc.Text()) return t } func min(a, b int) int { if a >= b { return b } return a } func main() { var n int fmt.Scan(&n) a := make([]int, n) sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) mind := 1000000 for i := 0; i < n; i++ { a[i] = nextInt(sc) if i > 0 { mind = min(a[i]-a[i-1], mind) } } fmt.Println(mind) fmt.Println(a[n-1] - a[0]) }