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