#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m = 0;
  cin >> n >> m;
  int student[n][2];
  int cheakpoint[m][2];
  for (size_t i = 0; i < n; i++) {
    cin >> student[i][0] >> student[i][1];
  }
  for (size_t i = 0; i < m; i++) {
    cin >> cheakpoint[i][0] >> cheakpoint[i][1];
  }
  for (size_t i = 0; i < n; i++) {
    int mh = 0;
    int minmh = 100000000;
    int ans = 0;
    for (size_t q = 0; q < m; q++) {
      mh = abs(student[i][0] - cheakpoint[q][0]) +
           abs(student[i][1] - cheakpoint[q][1]);
      if (minmh > mh) {
        minmh = mh;
        ans = q + 1;
      }
    }
    cout << ans << endl;
  }
}
