#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  for (int(i) = 0; (i) < (n); (i)++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  vector<pair<int, int> > w;
  for (int(i) = 0; (i) < (m); (i)++) {
    int x, y;
    cin >> x >> y;
    w.push_back({x, y});
  }
  vector<int> ans;
  for (__typeof(v.begin()) e = v.begin(); e != v.end(); e++) {
    int x = e->first;
    int y = e->second;
    int mn = INF;
    int mni = -1;
    for (int(i) = 0; (i) < (n); (i)++) {
      int xx = w[i].first;
      int yy = w[i].second;
      int d = (int)abs(xx - x) + (int)abs(yy - y);
      if (d < mn) {
        mni = i;
        mn = d;
      }
    }
    ans.push_back(mni);
  }
  for (int(i) = 0; (i) < (int((ans).size())); (i)++) cout << ans[i] + 1 << "\n";
  cout << '\n';
}
