use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf);
    let mut s = buf.split_whitespace();
    let n: u8 = s.next().unwrap().parse().unwrap();
    let m: u8 = s.next().unwrap().parse().unwrap();

    let students: Vec<(i32, i32)> = (0..n).map(|i| {
       let x: i32 = s.next().unwrap().parse().unwrap();
       let y: i32 = s.next().unwrap().parse().unwrap();
       (x, y)
    }).collect();
    let checkpoints: Vec<(i32, i32)> = (0..m).map(|_| {
       let x: i32 = s.next().unwrap().parse().unwrap();
       let y: i32 = s.next().unwrap().parse().unwrap();
       (x, y)
    }).collect();

    students.iter().for_each(|student| {
        let dists = checkpoints.iter().enumerate().map(|(idx, cp)| {
          let dist = (student.0 - cp.0).abs() +
                     (student.1 - cp.1).abs();
          (dist, idx)
        });
        let cp_num = dists.min().unwrap().1 + 1;
        println!("{}", cp_num);
    })
}
