#include <bits/stdc++.h>
using namespace std;
long long INF = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > p(n), q(n);
  for (int i = (0); i < (n); ++i) {
    int a, b;
    cin >> a >> b;
    p[i] = pair<int, int>(a, b);
  }
  for (int i = (0); i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    q[i] = pair<int, int>(a, b);
  }
  for (int i = (0); i < (n); ++i) {
    int ans = 0;
    long long mdis = INF, dis;
    for (int j = (0); j < (m); ++j) {
      dis = abs(p[i].first - q[j].first) + abs(p[i].second - q[j].second);
      if (dis < mdis) {
        mdis = dis;
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
}
