#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    int mindist = 300000000;
    int mini = -1;
    for (int cpi = 0; cpi < m; cpi++) {
      int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi]);
      if (mindist > dist) {
        mindist = dist;
        mini = i;
      }
    }
    cout << mini << endl;
  }
}
