#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
struct Posi {
  ll x;
  ll y;
};
int main() {
  ll N, M;
  cin >> N >> M;
  struct Posi P[N];
  struct Posi C[N];
  for (int(i) = 0; (i) < (N); (i)++) {
    ll a, b;
    cin >> a >> b;
    P[i].x = a;
    P[i].y = b;
  }
  for (int(i) = 0; (i) < (M); (i)++) {
    ll c, d;
    cin >> c >> d;
    C[i].x = c;
    C[i].y = d;
  }
  vector<ll> ans;
  for (int(i) = 0; (i) < (N); (i)++) {
    ll min = -1;
    ll num = 0;
    for (int(j) = 0; (j) < (M); (j)++) {
      ll tmp = abs(P[i].x - C[j].x) + abs(P[i].y - C[j].y);
      if (min == -1) {
        min = tmp;
        num = j;
      } else if (min > tmp) {
        min = tmp;
        num = j;
      }
    }
    ans.push_back(num + 1);
  }
  for (int(i) = 0; (i) < (N); (i)++) {
    cout << ans[i] << endl;
  }
}
