#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> ab(n);
  vector<tuple<long long, long long, long long>> cd(m);
  for (int i = 0; i < (n); ++i) {
    long long a, b;
    cin >> a >> b;
    ab[i] = {a, b};
  }
  for (int i = 0; i < (m); ++i) {
    long long c, d;
    cin >> c >> d;
    cd[i] = {i, c, d};
  }
  for (int i = 0; i < (n); ++i) {
    long long min = 1e18;
    int tmp = 0;
    for (int j = 0; j < (m); ++j) {
      if (abs(ab[i].first - get<1>(cd[j])) + abs(ab[i].second - get<2>(cd[j])) <
          min) {
        min = abs(ab[i].first - get<1>(cd[j])) +
              abs(ab[i].second - get<2>(cd[j]));
        tmp = get<0>(cd[j]) + 1;
      }
    }
    cout << tmp << endl;
  }
  return 0;
}
