n,m=gets.split.map &:to_i
ab=[]
n.times do |i|
    ab<<gets.split.map(&:to_i)
end
cd=[]
m.times do |i|
    cd<<gets.split.map(&:to_i)
end

ab.each do |p|
    Ans=0
    Min=100000
    m.times do |i|
        dist=(p[0]-cd[i][0]).abs+(p[1]-cd[i][1]).abs
        if Min>dist
            Min=dist
            Ans=i+1
        end
    end
    p Ans
end