#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int a[60], b[60], c[60], d[60];
  int k[60], l, h;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < m; ++j) {
    cin >> c[j] >> d[j];
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i) {
      k[i] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (i == 0) {
        h = k[i];
        l = i;
      } else {
        if (k[i] < h) {
          h = k[i];
          l = i;
        }
      }
    }
    cout << l + 1 << endl;
  }
}
