process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function abs(x){
	if (x < 0) return -x;
	return x;
}

function calc_min(x,y,c,d,M){
	var idx=1, dis=abs(x-c[1])+abs(y-d[1]);
	for (var i=2; i <= M; i++){
		if (dis > abs(x-c[i]) + abs(y-d[i])){
			dis = abs(x-c[i]) + abs(y-d[i]);
			idx = i;
		}
	}
	return idx;
}

function main() {
	var N, M, s;
	var a=[0], b=[0], c=[0], d=[0];
	s = readLine().split(" ");
	N = parseInt(s[0]); M = parseInt(s[1]);
	for (var i=1; i <= N; i++){
		s = readLine().split(" ");
		x = parseInt(s[0]); y = parseInt(s[1]);
		a.push(x);
		b.push(y);
	}
	for (var i=1; i <= M; i++){
		s = readLine().split(" ");
		x = parseInt(s[0]); y = parseInt(s[1]);
		c.push(x);
		d.push(y);
	}
	for (var i=1; i <= N; i++){
		console.log(calc_min(a[i],b[i],c,d,M).toString());
	}
}
