#include<cmath>
#include<iostream>
using namespace std;
const int MAXN = 51;
int a[MAXN], b[MAXN], c[MAXN], d[MAXN];
inline int dist(int x1, int y1, int x2, int y2) {
	return abs(x1-x2) + abs(y1-y2);
}
int main() {
	int N, M;
	cin >> N >> M;
	for (int i = 1; i <= N; i++) {
		cin >> a[i] >> b[i];
	}
	for (int j = 1; j <= M; j++) {
		cin >> c[j] >> d[j];
	}
	for (int i = 1; i <= N; i++) {
		int min_dist = dist(a[i], b[i], c[1], d[1]);
		int id = 1;
		for (int j = 2; j <= M; j++) {
			int cur_dist = dist(a[i], b[i], c[j], d[j]);
			if (cur_dist < min_dist) {
				min_dist = cur_dist;
				id=j; 
			}
		}
		cout<<j<<endl;
	}
	return 0;
}