#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(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 dist = 100000;
    int l, num;
    for (int(j) = 0; (j) < (m); (j)++) {
      l = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (l < dist) {
        dist = l;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
  return 0;
}
