#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int min = pow(10, 8);
  int num;
  int dis = 0;
  cin >> n >> m;
  vector<vector<int>> student(n, vector<int>(2));
  vector<vector<int>> point(m, vector<int>(2));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> student.at(i).at(j);
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> point.at(i).at(j);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      dis = abs(student.at(i).at(0) - point.at(j).at(0)) +
            abs(student.at(i).at(1) - point.at(j).at(1));
      if (dis < min) {
        min = dis;
        num = j + 1;
      }
    }
    cout << num << endl;
    min = pow(10, 8);
  }
  return 0;
}
