#include <bits/stdc++.h>
using namespace std;
pair<int, int> students[60];
pair<int, int> checkP[60];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> students[i].first >> students[i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> checkP[i].first >> checkP[i].second;
  }
  int cdist;
  for (int i = 0; i < n; i++) {
    int mindist = 1e9, minin = -1;
    for (int j = 0; j < m; j++) {
      cdist = (abs(students[i].first - checkP[i].first)) +
              (abs(students[i].second - checkP[i].second));
      if (cdist < mindist) {
        mindist = cdist;
        minin = j;
      }
    }
    cout << minin + 1 << endl;
  }
  return 0;
}
