#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<long long int, long long int>> Students(N);
  vector<pair<long long int, long long int>> Points(M);
  for (int i = 0; i < N; i++) {
    long long int a, b;
    cin >> a >> b;
    Students[i] = make_pair(a, b);
  }
  for (int i = 0; i < M; i++) {
    long long int a, b;
    cin >> a >> b;
    Points[i] = make_pair(a, b);
  }
  vector<int> ans;
  for (int i = 0; i < N; i++) {
    long long int tdist = 1000000000, tptnr = 100;
    for (int j = 0; j < M; j++) {
      int td, tp;
      td = abs(Students[i].first - Points[j].first);
      tp = j + 1;
      if (td < tdist)
        td = tdist, tptnr = tp;
      else if (td == tdist) {
        if (tptnr > tp) tptnr = tp;
      } else {
        continue;
      }
    }
    ans.push_back(tptnr);
  }
  for (int i = 0; i < N; i++) cout << ans[i] << endl;
}
