#include <stdlib.h>


int main()
{
	int point[50][2];
	int check[50][2];
	int N,M;
	int i, j;
	int minditance;
	int distance;
	int minnum = 0;

	scanf("%d%d",&N,&M);
	for (i = 0; i < N; i++) {
		scanf("%d%d", &point[i][0], &point[i][1]);
	}
	for (i = 0; i < M; i++) {
		scanf("%d%d", &check[i][0], &check[i][1]);
	}

	for (i = 0; i < N; i++) {
		minditance = INT_MAX;
		for (j = 0; j < M; j++) {
			distance = abs(point[i][0] - check[j][0]) + abs(point[i][1] - check[j][1]);
			if (minditance > distance) {
				minditance = distance;
				minnum = j;
			}
		}
		printf("%d\n", minnum + 1);
	}


    return 0;
}