#intclude<bits/stdc++.h>
using namespace std;

int main (){
	int n,m;
	cin >> n >> m;
	const int NMMAX=50;
	int A[NMMAX],B[NMMAX],C[NMMAX],D[NMMAX];
	for(int i=0;i<n;++i){
	cin >> A[i] >> B[i];
	}
	for(int i=0;i<m;++i){
	cin >> C[i] >> D[i];
	}

	for(int i=0;i<n;i++){
	int checkpoint = 1;
	int min_dist = abs(A[i]-C[0])+abs(B[i]-D[0]);

	for(int j=0;j<m;j++){
		const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]);
		if(min_dist>cur_dist){
			min_dist = cur_dist;
			checkpoint = j+1;
			}
		}
	cout << checkpoint << endl; 
	}
}
