#include <bits/stdc++.h>
using namespace std;
struct point {
  int x;
  int y;
  point(int a, int b) : x(a), y(b) {}
  point() : x(0), y(0) {}
  int operator-(const point& a) { return abs(x - a.x) + abs(y - a.y); }
};
vector<point> p, c;
int n, m;
int culcpos(int a) {
  int k = 1e9;
  int res = -1;
  for (int i = 0; i < m; i++) {
    int t = p[a] - c[i];
    if (t < k) {
      k = t;
      res = i;
    }
  }
  return res;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    p.emplace_back(x, y);
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    c.emplace_back(x, y);
  }
  for (int i = 0; i < n; i++) {
    cout << culcpos(i) << endl;
  }
}
