#include <bits/stdc++.h>
using namespace std;
int main() {
  const int MAX_NM = 50, MAX_DIST = 200000000;
  int n, m, a[MAX_NM], b[MAX_NM], c[MAX_NM], d[MAX_NM];
  cin >> n >> m;
  for (int i = (int)0; i < (int)n; i++) cin >> a[i] >> b[i];
  for (int i = (int)0; i < (int)m; i++) cin >> c[i] >> d[i];
  for (int i = (int)0; i < (int)n; i++) {
    int dist = MAX_DIST, nearest;
    for (int j = (int)0; j < (int)n; j++) {
      int tmpdist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist > tmpdist) {
        dist = tmpdist;
        nearest = j + 1;
      }
    }
    cout << nearest << endl;
  }
}
