#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<point> a(n), b(m);
  for (int i = 0; i < n; ++i) {
    point k;
    cin >> k.x >> k.y;
    a[i] = k;
  }
  for (int i = 0; i < m; ++i) {
    point k;
    cin >> k.x >> k.y;
    b[i] = k;
  }
  for (int i = 0; i < n; ++i) {
    int len = 1e9;
    int id = 0;
    for (int j = 0; j < n; ++j) {
      int dis = abs(b[j].x - a[i].x) + abs(b[j].y - a[i].y);
      if (dis < len) {
        len = dis;
        id = j;
      }
    }
    cout << id + 1 << '\n';
  }
  return 0;
}
