#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cout << fixed << setprecision(6);
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> s(m);
  vector<long long> t(m);
  vector<int> checkPoint(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> s[i] >> t[i];
  }
  for (int i = 0; i < n; i++) {
    long long m = N * 1000;
    int memNum = 0;
    for (int j = 0; j < m; j++) {
      long long mem = abs(a[i] - s[j]) + abs(b[i] - t[j]);
      if (mem < m) {
        m = mem;
        memNum = j + 1;
      }
    }
    checkPoint[i] = memNum;
  }
  for (long long i = (long long)(0); i < (long long)(n); ++i) {
    cout << checkPoint[i] << "\n";
    ;
  }
  return 0;
}
