#include <bits/stdc++.h>
using namespace std;
int main() {
  int studentCount;
  cin >> studentCount;
  int checkpointCount;
  cin >> checkpointCount;
  vector<int> studentsX;
  vector<int> studentsY;
  vector<int> checkpointsX;
  vector<int> checkpointsY;
  for (int i = 0; i < studentCount; ++i) {
    int sX;
    int sY;
    cin >> sX;
    cin >> sY;
    studentsX.emplace_back(sX);
    studentsY.emplace_back(sY);
  }
  for (int i = 0; i < checkpointCount; ++i) {
    int cX;
    int cY;
    cin >> cX;
    cin >> cY;
    checkpointsX.emplace_back(cX);
    checkpointsY.emplace_back(cY);
  }
  for (int i = 0; i < studentCount; ++i) {
    int sX = studentsX[i];
    int sY = studentsY[i];
    double minDistance = INT_MAX;
    int checkpointId = 0;
    for (int j = 0; j < checkpointCount; ++j) {
      int cX = checkpointsX[j];
      int cY = checkpointsY[j];
      double currentDistance = abs(sX - cX) + abs(sY - cY);
      if (currentDistance < minDistance) {
        minDistance = currentDistance;
        checkpointId = j + 1;
      }
    }
    cout << checkpointId << endl;
  }
  return 0;
}
