#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

int main()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);

	int N, M;
	
	cin >> N >> M;

	ll a[N], b[N], c[M], d[M];
	
	rep(i, N)
	{
		cin >> a[i] >> b[i];
	}

	ll e[N][M];

	rep(i, M)
	{
		cin >> c[i] >> d[i];
		for(int j = 0; j < N; j++)
		{
			e[j][i] = abs(a[j] - c[i]) + abs(b[j] - d[i]);
		}
	}

	rep(i, N)
	{
		ll min = MOD;
		int idx = -1;
		rep(j, M)
		{
			if (e[i][j] < min)
			{
				min = e[i][j];
				idx = j;
			}
		}
		cout << j + 1 << endl;
	}

	
	return 0;
}
