#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  string s;
  cin >> n >> m;
  vector<pair<int, int>> v(n);
  vector<pair<int, int>> u(n);
  for (int i = 0; i < (int)(n); i++) {
    int x, y;
    cin >> x >> y;
    pair<int, int> p = make_pair(x, y);
    v[i] = p;
  }
  for (int i = 0; i < (int)(m); i++) {
    int x, y;
    cin >> x >> y;
    pair<int, int> p = make_pair(x, y);
    u[i] = p;
  }
  int id = 0;
  for (int i = 0; i < (int)(n); i++) {
    int ans = 1 << 30;
    for (int j = 0; j < (int)(m); j++) {
      if (ans > abs(v[i].first - u[j].first) + abs(v[i].second - u[j].second)) {
        ans = min(
            ans, abs(v[i].first - u[j].first) + abs(v[i].second - u[j].second));
        id = j;
      }
    }
    cout << id + 1 << endl;
  }
  return 0;
}
