#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
const int INF = 100100100;
int main() {
  int N, M, a, b, c, d;
  cin >> N >> M;
  vector<pint> starts(N);
  for (ll i = (0); i < (ll)(N); i++) {
    cin >> a >> b;
    starts[i] = pint(a, b);
  }
  vector<pint> goals(M);
  for (ll i = (0); i < (ll)(M); i++) {
    cin >> c >> d;
    goals[i] = pint(c, d);
  }
  for (ll i = (0); i < (ll)(N); i++) {
    int ans = 1, mi = INF;
    int x1 = starts[i].first, y1 = starts[i].second;
    for (ll j = (0); j < (ll)(M); j++) {
      int x2 = goals[j].first, y2 = goals[j].second;
      int m = abs(x1 - x2) + abs(y1 - y2);
      if (mi > m) {
        mi = m;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
