#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 30;
const double EPS = 1e-10;
const double pi = 3.14159265359;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int n, m;
int a[55], b[55], c[55], d[55];

int main()
{
	cin >> n >> 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++) {
		int d = INF;
		int CP = 0;
		for (int j = 0;j < m;j++) {
			if (d > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
				CP = j;
			}
		}
		cout << CP << endl;
	}

	return 0;
}
