#include <bits/stdc++.h>
using namespace std;
template <class T>
using vt = vector<T>;
template <class T>
using vvt = vector<vector<T>>;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> student(N);
  vector<pair<int, int>> check(M);
  for (int i = 0; i < (N); i++) cin >> student[i].first >> student[i].second;
  for (int i = 0; i < (M); i++) cin >> check[i].first >> check[i].second;
  for (int i = 0; i < (N); i++) {
    int min = abs(student[i].first - check[0].first) +
              abs(student[i].second - check[0].second);
    int min_n = 0;
    for (int j = 0; j < (M); j++) {
      if (min > abs(student[i].first - check[j].first) +
                    abs(student[i].second - check[j].second)) {
        min_n = i;
        min = abs(student[i].first - check[j].first) +
              abs(student[i].second - check[j].second);
      }
    }
    cout << min_n + 1 << endl;
  }
  return 0;
}
