#include<iostream>
#include<vector>
#include<cstdlib>
#include<algorithm>
#include<functional>

using namespace std;

void main() {
	int N, M;
	typedef pair<long, long> p;
	vector<p> n, m;
	vector<int> res;

	cin >> N >> M;

	for (int i = 0;i < N;i++) {
		long a, b;
		cin >> a >> b;
		n.push_back(make_pair(a, b));
	}

	for (int i = 0;i < M;i++) {
		long c, d;
		cin >> c >> d;
		m.push_back(make_pair(c, d));
	}

	for (int i = 0;i < n.size();i++) {
		int near = 51;
		long min = 1000000000;
		for (int j = 0;j < m.size();j++) {
			long d = abs(n[i].first - m[j].first) + abs(n[i].second - m[j].second);

			if (d < min) {
				near = j;
				min = d;
			}
		}
		cout <<near+1 << endl;
	}
	return;
}