#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> player(100);
  for (int i = 0; i < N; i++) {
    cin >> player[i].first >> player[i].second;
  }
  vector<pair<int, int>> checkp(100);
  for (int i = 0; i < M; i++) {
    cin >> checkp[i].first >> checkp[i].second;
  }
  for (int i = 0; i < N; i++) {
    int manh = 200000001;
    int num;
    for (int j = 0; j < M; j++) {
      int absx = abs(player[i].first - checkp[j].first);
      int absy = abs(player[i].second - checkp[j].second);
      if (manh > absx + absy) {
        manh = absx + absy;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
}
