#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> ab(n, make_pair(0, 0)), cd(m, make_pair(0, 0));
  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;
  }
  int ans;
  int distance;
  for (int i = 0; i < n; i++) {
    int mi = 100000001;
    for (int j = 0; j < m; j++) {
      distance =
          abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second);
      if (distance < mi) {
        mi = distance;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
