#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, res, man, man2;
  int a[50], b[50], c[50], d[50];
  int x, y, w, z;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cin >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i];
    cin >> d[i];
  }
  for (int i = 0; i < n; i++) {
    res = 1;
    x = a[i] - c[0];
    y = b[i] - d[0];
    man = abs(x + y);
    for (int j = 1; j <= m; j++) {
      w = a[i] - c[j];
      z = b[i] - d[j];
      man2 = abs(w + z);
      if (man > man2) {
        man = man2;
        res = j + 1;
      }
    }
    cout << res << endl;
  }
}
