#include <set>
#include <map>
#include <queue>
#include <deque>
#include <cstdio>
#include <string>
#include <vector>
#include <math.h>
#include <time.h>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <conio.h>
#include <iostream>
#include <algorithm>
#include <windows.h>
#define ll long long
#define StopProgram() exit(0)
#define Max(a,b) (b<a ? a : b)
#define Min(a,b) (a<b ? a : b)
#define Abs(x) ((x) > 0 ? (x) : -(x))
#define Fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
using namespace std;
int n, m, a[55], b[55], c[55], d[55];
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
	for (int i = 1; i <= m; i++) scanf("%d%d", &c[i], &d[i]);
	for (int i = 1; i <= n; i++) {
		int e = -1;
		for (int j = 1; j <= m; j++) if (e == -1 || abs(a[i]-c[j])+abs(b[i]-d[j])<abs(a[i]-c[e])+abs(b[i]-d[e])) e=j;
		printf("%d\n", e);
	}
	return 0;
}