#include <iostream>
#Include <vector>
#include <algorithm>

using namespace std;

struct Point {
  int x, y;
  Point(int x, int y):x(x), y(y) { }
};

int main() {
  int N, M; cin >> N >> M;
  vector<Point> a(N);
  vector<Point> b(M);

  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    a[i] = Point(x, y);
  }

  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    b[i] = Point(x, y);
  }

  for (int i = 0; i < N; i++) {
    Point &p = a[i];
    int idx = 0;
    int minval = 1e9+10;
    for (int j = 1; j < M; j++) {
      int val = abs(p.y - b[i],y) + abs(p.x - b[i].x);
      if (val < minval) {
        idx = j;
        minval = val;
      }
    }
    cout << idx << endl;
  }
  return 0;
}