#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> ab(n), cd(m);
  for (int i = 0; i < n; i++) cin >> ab[i].first >> ab[i].second;
  for (int i = 0; i < m; i++) cin >> cd[i].first >> cd[i].second;
  for (int i = 0; i < n; i++) {
    long long temp = 1 << 20, num = 0;
    for (int j = 0; j < m; j++) {
      if (temp >
          abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second)) {
        temp =
            abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second);
        num = j;
      }
    }
    cout << num + 1 << endl;
  }
}
