use std::io::{stdin, Read}; fn main() { let mut buf = String::new(); stdin().read_to_string(&mut buf).unwrap(); let mut tok = buf.split_whitespace(); let mut get = || tok.next().unwrap(); macro_rules! get { ($t:ty) => (get().parse::<$t>().unwrap()); () => (get!(i64)); } let n = get!(); let first = get!(); let mut last = first; let mut min = 99999999; for _ in 1..n { let x = get!(); if x - last < min { min = x - last; } last = x; } let max = last - first; println!("{}", min); println!("{}", max); }