#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, d, dx, dy;
  vector<vector<int> > ab, cd;
  cin >> n >> m;
  ab.resize(n);
  for (int i = 0; i < n; i++) {
    ab[i].resize(2);
  }
  cd.resize(m);
  for (int i = 0; i < m; i++) {
    cd[i].resize(2);
  }
  for (int i = 0; i < n; i++) {
    cin >> ab[i][0] >> ab[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> cd[i][0] >> cd[i][1];
  }
  for (int i = 0; i < n; i++) {
    int min = 100000000, min_pos = 1;
    for (int j = 0; j < m; j++) {
      dx = ab[i][0] - cd[j][0];
      if (dx < 0) dx *= -1;
      dy = ab[i][1] - cd[j][1];
      if (dy < 0) dy *= -1;
      d = dx + dy;
      if (min > d) {
        min = d;
        min_pos = j + 1;
      }
    }
    cout << min_pos << endl;
  }
  return 0;
}
