use std::io::*; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec = itr.map(|x| x.parse().unwrap()).collect(); let mx = a[n - 1] - a[0]; let mut mn = a[1] - a[0]; for i in 1..n - 1 { if mn > a[i + 1] - a[i] { mn = a[i + 1] - a[i]; } } println!("{}", mn); println!("{}", mx); }