let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, M) = (input[0], input[1])
let student = (0..<N).map{_ in readLine()!.characters.split(" ").map{Int(String($0))!}}
let checkpoint = (0..<M).map{_ in readLine()!.characters.split(" ").map{Int(String($0))!}}
for i in 0..<N {
    var ans = 1
    var minDist = abs(student[i][0] - checkpoint[0][0]) + abs(student[i][1] - checkpoint[0][1])
    for j in 1..<M {
        let dist = abs(student[i][0] - checkpoint[j][0]) + abs(student[i][1] - checkpoint[j][1])
        if dist < minDist {
            minDist = dist
            ans = j + 1
        }
    }
    print(ans)
}