#include<stdio.h>
#include<math.h>
int main() {
	int n, m;
	scanf_s("%d%d", &n, &m);
	double a[50];
	double b[50];
	double c[50];
	double d[50];
	double h = pow(10, 8),i,g;
	for (int k = 0; k < n; k++) {
		scanf_s("%lf%lf", &a[k], &b[k]);
	}
	for (int k = 0; k < m; k++) {
		scanf_s("%lf%lf", &c[k], &d[k]);
	}
	for (int e= 0; e < n; e++) {
		for (int f = 0; f < m; f++) {
			g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
			if (h > g) {
				h = g;
				i = f + 1;
			}
		}
		printf("%f\n", i);
	}
	return 0;
}