# frozen_string_literal: true

n, m = gets.split.map(&:to_i)
a, b = Array.new(n) { gets.split.map(&:to_i) }.transpose
c, d = Array.new(m) { gets.split.map(&:to_i) }.transpose

n.times do |i|
  min = 4 * 10**8 + 1
  checkpoint = nil

  n.times do |j|
    tmp = (a[i] - c[j]).abs + (b[i] - d[j]).abs

    if min > tmp
      min = tmp
      checkpoint = j + 1
    end
  end

  puts checkpoint
end