#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, x, y;
  vector<int> s_x, s_y, c_x, c_y;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> x;
    s_x.push_back(x);
    cin >> y;
    s_y.push_back(y);
  }
  for (i = 0; i < n; i++) {
    cin >> x;
    c_x.push_back(x);
    cin >> y;
    c_y.push_back(y);
  }
  int res, d;
  for (i = 0; i < n; i++) {
    d = 100000000;
    for (j = 0; j < m; j++) {
      int tmp;
      tmp = abs(s_x[i] - c_x[j]) + abs(s_y[i] - c_y[j]);
      if (j == 0) {
        d = tmp;
        res = j;
      } else if (tmp < d) {
        d = tmp;
        res = j;
      }
    }
    cout << res + 1 << endl;
  }
  return 0;
}
