#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[60], b[60], c[60], d[60];
int main()
{
	int N, M;
	cin >> N >> M;
	for (int i = 0; i < N; i++) cin >> a[i] >> b[i];
	for (int i = 0; i < M; i++) cin >> c[i] >> d[i];
	ll min = 0;
	int p = 0;
	for (int i = 0; i < N; i++) {
		min = mod;
		for (int j = 0; j < M; j++) {
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
				min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				p = j;
			}
		}
		cout << p + 1 << endl;
	}
}
