#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ab[50][2], cd[50][2];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> ab[i][0] >> ab[i][1];
  for (int i = 0; i < m; ++i) cin >> cd[i][0] >> cd[i][1];
  for (int i = 0; i < n; ++i) {
    pair<int, int> minp(INT_MAX, INT_MAX);
    for (int j = 0; j < m; ++j) {
      pair<int, int> t(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]),
                       j + 1);
      minp = min(minp, t);
    }
    cout << minp.second << endl;
  }
  return 0;
}
