fn main() { let mut buf = String::new(); let mut input = { use std::io::Read; std::io::stdin().read_to_string(&mut buf).unwrap(); buf.split_whitespace() }; let n: usize = input.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); let min = (0..(n - 1)).map(|i| a[i + 1] - a[i]).min().unwrap(); let max = a[n - 1] - a[0]; println!("{}", min); println!("{}", max); }