#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int sdt[n][2], pt[m][2];
  for (int i = 0; i < n; ++i) cin >> sdt[i][0] >> sdt[i][1];
  for (int i = 0; i < m; ++i) cin >> pt[i][0] >> pt[i][1];
  for (int i = 0; i < n; ++i) {
    int min = 10000000, idx, d;
    for (int j = 0; j < m; ++j) {
      d = abs(sdt[i][0] - pt[j][0]) + abs(sdt[i][1] - pt[j][1]);
      if (d < min) {
        min = d;
        idx = j + 1;
      }
    }
    cout << idx << endl;
  }
  return 0;
}
