local n, m = io.read("*n", "*n")
local a = {}
for i = 1, n do
  a[i] = {io.read("*n", "*n")}
end
local b = {}
for i = 1, m do
  b[i] = {io.read("*n", "*n")}
end
local mab = math.abs
local function solve(i, j)
  return mab(a[i][1] - b[j][1]) + mab(a[i][2] - b[j][2])
end
for i = 1, n do
  local p, v = 1, solve(i, 1)
  for j = 2, m do
    local tv = solve(i, j)
    if tv < v then
      p, v = j, tv
    end
  end
  print(p)
end
