#include <bits/stdc++.h>
using namespace std;
const int INF_int = 1e9;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > student(n);
  for (int i = 0; i < (int)(n); i++) {
    int x, y;
    cin >> x >> y;
    student[i] = make_pair(x, y);
  }
  vector<pair<int, int> > checkpoint(m);
  for (int i = 0; i < (int)(m); i++) {
    int x, y;
    cin >> x >> y;
    checkpoint[i] = make_pair(x, y);
  }
  for (int i = 0; i < n; i++) {
    int res = INF_int, num = 0;
    for (int j = 0; j < m; j++) {
      int dis = abs(student[i].first - checkpoint[j].first) +
                abs(student[i].second - checkpoint[i].second);
      if (dis <= res) {
        if (dis == res) break;
        num = j + 1;
        res = dis;
      }
    }
    cout << num << endl;
  }
}
