#include <bits/stdc++.h>
using namespace std;
inline int dis(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}
int main() {
  int N, M;
  vector<int> a, b, c, d;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    int tmpa, tmpb;
    cin >> tmpa >> tmpb;
    a.push_back(tmpa);
    b.push_back(tmpb);
  }
  for (int i = 0; i < M; i++) {
    int tmpc, tmpd;
    cin >> tmpc >> tmpd;
    c.push_back(tmpc);
    d.push_back(tmpd);
  }
  for (int i = 0; i < N; i++) {
    int min = 0;
    for (int j = 1; j < M; j++) {
      if (dis(a[i], b[i], c[j], d[j]) < dis(a[i], b[i], c[min], d[min])) {
        min = j;
      }
    }
    cout << min + 1 << endl;
  }
  return 0;
}
