#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x, y;
  void set(int x1, int y1) {
    x = x1;
    y = y1;
  }
};
int calcDistance(Point p1, Point p2) {
  return abs(p1.x - p2.x) + abs(p1.y - p2.y);
}
int main() {
  int N, M;
  vector<Point> spvec;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    Point p;
    cin >> p.x >> p.y;
    spvec.push_back(p);
  }
  vector<Point> cpvec;
  for (int j = 0; j < M; j++) {
    Point p;
    cin >> p.x >> p.y;
    cpvec.push_back(p);
  }
  for (int i = 0; i < N; i++) {
    int min = INT_MAX;
    int minJ = 0;
    for (int j = 0; j < M; j++) {
      int distance = calcDistance(spvec[i], cpvec[j]);
      if (min > distance) {
        min = distance;
        minJ = j;
      }
    }
    cout << minJ + 1 << endl;
  }
  return 0;
}
