#include <iostream>
#include <math.h>

using namespace std;

int n, m, a[50], b[50], c[51], d[51], ans = 0, max = 0;

int main(){
	cin >> n >> m;
	for (int i = 0; i < n; i++){
		cin >> a[i] >> b[i];
	}
	for (int i = 1; i <= m; i++){
		cin >> c[i] >> d[i];
	}

	for (int i = 0; i < n; i++){
		max = abs(a[i] - c[1]) + abs(b[i] - d[1]);
		ans = 1;

		for (int j = 2; j <= m; j++){
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < max){
				max = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				ans = j;
			}
		}

		cout << ans << endl;
	}

	return 0;
}