N,M = gets.split.map(&:to_i)
stus,cpts = [],[]

N.times do
  stus << gets.split.map(&:to_i)
end

M.times do
  cpts << gets.split.map(&:to_i)
end

stus.each do |st|
  min_id,min = 0,200000001
  cpts.each.with_index(1) do |cp, id|
    dist = (st[0]-cp[0]).abs + (st[1]-cp[1]).abs
    if dist < min
      min = dist
      min_id = id
    end
  end
  puts min_id
end