#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> s(50, vector<int>(50));
  vector<vector<int>> c(50, vector<int>(50));
  for (int i = 0; i < n; i++) {
    cin >> s.at(0).at(i) >> s.at(1).at(i);
  }
  for (int i = 0; i < m; i++) {
    cin >> c.at(0).at(i) >> c.at(1).at(i);
  }
  for (int i = 0; i < n; i++) {
    int min = 200, k = 0;
    for (int j = 0; j < m; j++) {
      int t = 0;
      t = abs(s.at(0).at(i) - c.at(0).at(j)) +
          abs(s.at(1).at(i) - c.at(1).at(j));
      if (t < min) {
        min = t;
        k = j + 1;
      }
    }
    cout << k << endl;
  }
}
