#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n), c(m), d(m);
  vector<long long> v, w;
  for (int i = 0; i < (n); ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < (m); ++i) cin >> c[i] >> d[i];
  int ans = 0;
  for (int i = 0; i < (n); ++i) {
    long long mn = 1e8;
    for (int j = 0; j < (m); ++j) {
      if (mn > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        mn = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans = j + 1;
      }
    }
    v.push_back(ans);
  }
  for (int i = 0; i < (v.size()); ++i) {
    cout << v[i] << endl;
  }
}
