// --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char* argv[]) {

	long double N, M;
	long double min, cnt;

	cin >> N >> M;

	vector<long double>a(N), b(N);
	vector<long double>c(N), d(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];
	}

	for (int i = 0; i < N; i++) {
		min = 10e8;
		cnt = 0;
		for (int j = 0; j < M; j++) {
			if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
				min = abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j]);
				cnt = j + 1;
			}
		}
		cout << cnt << endl;
	}

	return 0;
}

