#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v1;
  vector<pair<int, int>> v2;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v1.push_back({a, b});
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v2.push_back({a, b});
  }
  for (int i = 0; i < v1.size(); i++) {
    int answer = 100000000, mini;
    for (int j = 0; j < v2.size(); j++) {
      if (abs(v1[i].first - v2[j].first) + abs(v1[i].second - v2[j].second) <
          answer) {
        answer =
            abs(v1[i].first - v2[j].first) + abs(v1[i].second - v2[j].second);
        mini = j + 1;
      }
    }
    cout << mini << endl;
  }
  return 0;
}
