#include <bits/stdc++.h>
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> c(m);
  vector<long long> d(m);
  for (long long i = 0; i < (n); ++i) cin >> a[i] >> b[i];
  for (long long i = 0; i < (m); ++i) cin >> c[i] >> d[i];
  for (long long i = 0; i < (n); ++i) {
    long long ans = -1;
    long long mnh = 1002003004005006;
    for (long long j = 0; j < (m); ++j) {
      if (mnh > abs(a[i] - c[j] + b[i] - d[j])) {
        mnh = min(mnh, abs(a[i] - c[j] + b[i] - d[j]));
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
