#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
struct D{
	int x, y;
};
int main(){
	int n, m, i, j, C[51] = {0}, t;
	D b[51], e[51];
	cin >> n >> m;
	for(i = 0; i < n; i++){
		cin >> b[i].x >> b[i].y;
	}
	for(i = 0; i < m; i++){
		cin >> e[i].x >> e[i].y;
	}
	for(i = 0; i < n; i++){
		int min = 400000000;
		for(j = 0; j < m; j++){
			if(min>abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y)){
				min = abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y);
				t = j+1;
			}
		}
		C[i] = t;
	} 
	for(i = 0; i < n; i++){
		cout << C[i] << endl;
	}
	return 0;
} #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
struct D{
	int x, y;
};
int main(){
	int n, m, i, j, C[51] = {0}, t;
	D b[51], e[51];
	cin >> n >> m;
	for(i = 0; i < n; i++){
		cin >> b[i].x >> b[i].y;
	}
	for(i = 0; i < m; i++){
		cin >> e[i].x >> e[i].y;
	}
	for(i = 0; i < n; i++){
		int min = 400000000;
		for(j = 0; j < m; j++){
			if(min>abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y)){
				min = abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y);
				t = j+1;
			}
		}
		C[i] = t;
	} 
	for(i = 0; i < n; i++){
		cout << C[i] << endl;
	}
	return 0;
} 