#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int s1[n], s2[n], t1[m], t2[m];
  for (int i = 0; i < n; i++) {
    cin >> s1[i] >> s2[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> t1[i] >> t2[i];
  }
  for (int i = 0; i < n; i++) {
    int res = 1 << 30;
    int ans = 0;
    for (int j = 0; j < n; j++) {
      int p = abs(s1[i] - t1[j]) + abs(s2[i] - t2[j]);
      if (res > p) {
        ans = j + 1;
        res = p;
      }
    }
    cout << ans << endl;
  }
}
