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