use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: usize = read();
    let m: usize = read();
    let ab: Vec<(i64, i64)> = (0..n).map(|_| (read(), read())).collect();
    let cd: Vec<(i64, i64)> = (0..m).map(|_| (read(), read())).collect();

    for (a, b) in ab {
        let mut min = (cd[0].0 - a).abs() + (cd[0].1 - b).abs();
        let mut checkpoint = 1;
        for (i, (c, d)) in cd.iter().enumerate() {
            if min > (c - a).abs() + (d - b).abs() {
                min = (c - a).abs() + (d - b).abs();
                checkpoint = i + 1;
            }
        }
        println!("{}", checkpoint)
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}
