(binding [*unchecked-math* true]
  (let [med      (fn [v] (get (vec (sort v)) (int (Math/floor (/ (count v) 2)))))
        cont-sub (fn [n v] (for [i (range 1 (inc n))]
                             (loop [vect v
                                    r    []]
                               (if (> i (count vect))
                                 r
                                 (recur (drop 1 vect) (conj r (take i vect)))))))
        n        (Integer/parseInt (read-line))
        v        (map #(Integer/parseInt %) (clojure.string/split (read-line) #"\s"))]
    (println (med (flatten (map (fn [vs] (map med vs)) (cont-sub n v)))))))