#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long, long>> s;
  vector<pair<long, long>> p;
  for (int i = 0; i < n; i++) {
    long a, b;
    cin >> a >> b;
    s.push_back(pair<long, long>{a, b});
  }
  for (int i = 0; i < m; i++) {
    long c, d;
    cin >> c >> d;
    p.push_back(pair<long, long>{c, d});
  }
  for (auto&& x : s) {
    long min = 1e9;
    long index = -1;
    for (int i = m - 1; i >= 0; i--) {
      long d = abs(x.first - p[i].first) + abs(x.second - p[i].second);
      if (d < min) {
        min = d;
        index = i + 1;
      }
    }
    cout << index << "\n";
  }
}
