let n, m = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ab_s = Array.init n @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a, b
let cds = Array.init m @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a, b
let f (x, y) (x2, y2) = abs (x - x2) + abs (y - y2)
let g ab =
  Array.fold_left (fun (mi, i) cd -> min mi (f ab cd, i), i + 1) ((max_int, -1), 1) cds
  |> fst |> snd |> Printf.printf "%d\n"
let _ = Array.iter g ab_s