line = gets.chomp.split(" ")

students = []
line[0].to_i.times do
    position = gets.chomp.split(" ")
    students.push(position.map!(&:to_i))
end

points = []
line[1].to_i.times do
    position = gets.chomp.split(" ")
    points.push(position.map!(&:to_i))
end

line[0].to_i.times do |i|
    ans = 0
        min = 10000000
    line[1].to_i.times do |j|
        dist = (students[i][0] - points[j][0]).abs + (students[i][1] - points[j][1]).abs
        if min > dist
            min = dist
            ans = j
        end
    end
    puts ans+1
end
