#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  vector<int> c(m), d(m);
  for (int i = 0; i < n; i++) cin >> c[i] >> d[i];
  long long kyori = 0;
  int kotae = 0;
  for (int i = 0; i < (int)(n); i++) {
    kyori = LLONG_MAX;
    for (int j = 0; j < (int)(m); j++) {
      long long tmp = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      if (tmp < kyori) {
        kyori = tmp;
        kotae = j + 1;
      }
    }
    cout << kotae << endl;
  }
  return 0;
}
