#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, i, j, x1[51], x2[51], y1[51], y2[51], get, ss;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> x1[i] >> y1[i];
  for (i = 0; i < m; i++) cin >> x2[i] >> y2[i];
  for (i = 0; i < m; i++) {
    ss = 2100000000, get = 0;
    for (j = 0; j < n; j++) {
      if ((abs(x1[i] - x2[j])) + (abs(y1[i] - y2[j])) < ss) {
        get = j, ss = (abs(x1[i] - x2[j])) + (abs(y1[i] - y2[j]));
      }
    }
    cout << get + 1 << endl;
  }
}
