n,m = gets.split.map(&:to_i)

l = []
o = []

n.times do 
    a,b = gets.split.map(&:to_i)
    l << a
    o << b
end

p = []
q = []
m.times do
    c,d = gets.split.map(&:to_i)
    p << c
    q << d
end

(0..n - 1).each do |i|
    k = 100000000000000
    point = 0
    (0..m - 1).each do |j|
        dist = (p[j] - l[i]).abs + (q[j] - o[i]).abs
        if dist < k
            point = j + 1
            k = dist
        end
    end
    puts point
end