#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > stu, chk;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    stu.push_back(make_pair(a, b));
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    chk.push_back(make_pair(a, b));
  }
  for (int i = 0; i < n; i++) {
    int mnd = INT_MAX;
    int ind = 0;
    for (int j = 0; j < m; j++) {
      int di =
          abs(stu[i].first - chk[j].first) - abs(stu[i].second - chk[j].second);
      if (di < mnd) {
        ind = j + 1;
        mnd = di;
      }
    }
    cout << ind << endl;
  }
}
