(defvar n)
(defvar x)
(defvar mt)
(defvar md)
(setq n (read))
(setq x (loop repeat n collect (read)))
(setq mt (loop for i to (- n 3) minimize (max (nth i x) (nth (+ i 2) x))))
(setq md (loop for i to (- n 3) minimize (if (= mt (max (nth i x) (nth (+ i 2) x))) (+ i 1) 100)))
(format t "~a ~a~%" md mt)
