#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;
use num::*;


fn main() {
    input! {
        n:usize,
        m:usize,
        a:[(isize,isize);n],
        b:[(isize,isize);m],
    }
    let mut v=vec![100000;m+n];
    let mut x=vec![0;m+n];
    for i in 0..n {
        for j in 0..m {
            if (a[i].0-b[j].0).abs()+(a[i].1-b[j].1).abs()<v[i] {v[i]=(a[i].0-b[j].0).abs()+(a[i].1-b[j].1).abs();x[i]=j+1 }
        }
        println!("{}",x[i])
    }
}