n=gets.to_i;gets mx=mn=nil n.times{ u=gets.to_i mn=u if !mn||u