#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y;
  cin >> n >> m;
  vector<pair<int, int>> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    a[i] = pair<int, int>(x, y);
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    b[i] = pair<int, int>(x, y);
  }
  for (int i = 0; i < n; i++) {
    int itr = 0, maxt = 999999;
    long long int tmp;
    for (int j = 0; j < m; j++) {
      tmp = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      if (tmp < maxt) {
        maxt = tmp;
        itr = j + 1;
      }
    }
    cout << itr << endl;
  }
}
