n, m = STDIN.gets.split.map(&:to_i)
students = []
n.times do
  students << STDIN.gets.split.map(&:to_i)
end
points = []
m.times do
  points << STDIN.gets.split.map(&:to_i)
end

default_min = 10 ** 8 * 2 + 1
min_points = []
students.each do |a, b|
  min = default_min
  num = -1
  points.each.with_index do |(c, d), i|
    d = (a - c).abs + (b - d).abs
    if min > d
      min = d
      num = i
    end
  end
  min_points << num
end

min_points.each do |num|
  puts num + 1
end
