#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  vector<long long> c(n), d(n);
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    long long mind = 4 * 1.0e8 + 100;
    for (int j = 0; j < m; j++) {
      long long cur = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (cur < mind) {
        mind = cur;
        ans[i] = j + 1;
      }
    }
  }
  for (auto x : ans) {
    cout << x << endl;
  }
}
