#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);
  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;
  for (int i = 0; i < (n); ++i) {
    long long mini = 100000010;
    for (int j = 0; j < (m); ++j) {
      long long dx = abs(a[i] - c[j]), dy = abs(b[i] - d[j]);
      if (mini > dx + dy) {
        mini = dx + dy;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
