N, M = gets.split.map(&:to_i)
S = []
N.times do
  S << gets.split.map(&:to_i)
end
C = []
M.times do
  C << gets.split.map(&:to_i)
end
p C
S.each do |xs, ys|
  ds = C.map {|xc, yc| (xs - xc).abs + (ys - yc).abs}
  puts ds.index(ds.min) + 1
end
