(defun solver (&aux (max 0) (min 101) temp)
  (let ((n (read)))
    (loop repeat n do
          (setf temp (read))
          (when (> temp max) (setf max temp))
          (when (< temp min) (setf min temp)))
    (format t "~A~%" (- max min))))

(solver)