(defn main [& args]
  (let [n (read)
        m (read)]
    (let [ab (into [] (for [i (range n)] [(read) (read)]))
          cd (into [] (for [i (range m)] [(read) (read)]))]
      (doseq [i (range n)]
        (let [min_  (atom 100000000000)
              index (atom 0)]
          (doseq [j (range m)]
            (let [distance (+ (Math/abs (- ((ab i) 0) ((cd j) 0)))
                              (Math/abs (- ((ab i) 1) ((cd j) 1))))]
              (when (> @min_ distance)
                (reset! min_ distance)
                (reset! index j))))
          (println (+ @index 1)))))))
(main)
