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