use std::io::prelude::*;

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

fn main() {
    let n: usize = input();
    let m: usize = input();
    let ab: Vec<(i64, i64)> = (0..n)
        .map(|_| {
            let a = input();
            let b = input();
            (a, b)
        })
        .collect();
    let cd: Vec<(i64, i64)> = (0..n)
        .map(|_| {
            let c = input();
            let d = input();
            (c, d)
        })
        .collect();

    for (a, b) in ab {
        let mut nearest = i64::max_value();
        let mut cp = 0;
        for j in 0..m {
            let (x, y) = cd[j];
            let d = (x - a).abs() + (y - b).abs();
            if d < nearest {
                cp = j;
            }
        }
        println!("{}", cp + 1);
    }
}
