#![allow(unused)]

use std::cmp::{max, min};
use std::io::stdin;
use std::str::FromStr;

fn input<T: FromStr>() -> Result<T, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse()
}

fn input_vec<T: FromStr>() -> Result<Vec<T>, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().split_whitespace().map(|x| x.parse()).collect()
}

fn main() {
    let (n, m): (usize, usize) = {
        let tmp = input_vec().unwrap();
        (tmp[0], tmp[1])
    };

    let mut stu: Vec<(i64, i64)> = Vec::with_capacity(n);
    for _i in 0..n {
        let tmp = {
            let t = input_vec().unwrap();
            (t[0], t[1])
        };
        stu.push(tmp);
    }

    let mut chk: Vec<(i64, i64)> = Vec::with_capacity(m);
    for _i in 0..m {
        let tmp = {
            let t = input_vec().unwrap();
            (t[0], t[1])
        };
        chk.push(tmp);
    }

    for (a, b) in stu.iter() {
        let mut closest = m + 1;
        let mut ord = std::usize::MAX;

        for (i, (c, d)) in chk.iter().enumerate().rev() {
            if ord
                >= ((*a as i64) - (*c as i64)).abs() as usize
                    + ((*b as i64) - (*d as i64)).abs() as usize
            {
                closest = i;
                ord = ((*a as i64) - (*c as i64)).abs() as usize
                    + ((*b as i64) - (*d as i64)).abs() as usize;
            }
        }

        println!("{}", closest + 1);
    }
}
