#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const double eps = 1e-8;
int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > st(n), cp(n);
  for (int i = (0); i < (n); ++i) {
    cin >> st[i].first >> st[i].second;
  }
  for (int i = (0); i < (m); ++i) {
    cin >> cp[i].first >> cp[i].second;
  }
  for (auto s : st) {
    int id = 0, mind = (1 << 29);
    for (int i = (0); i < (cp.size()); ++i) {
      int d = abs(cp[i].first - s.first) + abs(cp[i].second - s.second);
      if (d < mind) {
        mind = d;
        id = i;
      }
    }
    cout << id + 1 << endl;
  }
  return 0;
}
