#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using IP = pair<int, int>;
const ll linf = 1LL << 62;
const int inf = 99999999;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ll atcoder = 1e9 + 7;
ll gcd(ll a, ll b) {
  if (a % b == 0)
    return b;
  else
    gcd(b, a % b);
}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int main() {
  int a[100], b[100], c[100], d[100];
  int n, m;
  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 dist = inf;
    int ansm;
    for (int j = 0; j < m; j++) {
      if (dist > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        dist = min(dist, abs(a[i] - c[j]) + abs(b[i] - d[j]));
        ansm = j + 1;
      }
    }
    cout << ansm << endl;
  }
  return 0;
}
