#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x;
  int y;
} Coord;
int distance(Coord people, Coord point) {
  return abs(people.x - point.x) + abs(people.y - point.y);
}
int main() {
  int n, m;
  Coord people[55];
  Coord point[55];
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> people[i].x >> people[i].y;
  }
  for (int i = 1; i <= m; i++) {
    cin >> point[i].x >> point[i].y;
  }
  for (int i = 1; i <= n; i++) {
    int minDis = 100000001;
    int ansPoint;
    for (int j = 1; j <= m; j++) {
      int tmpDis = distance(people[i], point[j]);
      if (tmpDis < minDis) {
        minDis = tmpDis;
        ansPoint = j;
      }
    }
    cout << ansPoint << endl;
  }
  return 0;
}
