#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
const ll INF = 100000000000000000LL;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> p(n), c(m);
  for (int i = 0; i < (n); i++) cin >> p[i].first >> p[i].second;
  for (int i = 0; i < (m); i++) cin >> c[i].first >> c[i].second;
  for (int i = 0; i < (n); i++) {
    int d = 100000000;
    int res = 0;
    for (int j = 0; j < (m); j++) {
      int di = abs(p[i].first - c[j].first) + abs(p[i].second - c[j].second);
      if (di < d) {
        d = di;
        res = j + 1;
      }
    }
    cout << res << endl;
  }
}
