#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tost(const T& n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int const INF = 1001001001;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> sx(N), sy(N), cx(N), cy(N);
  for (int i = 0; i < (N); ++i) cin >> sx[i] >> sy[i];
  for (int j = 0; j < (M); ++j) cin >> cx[j] >> cy[j];
  for (int i = 0; i < (N); ++i) {
    int cur = 1 << 30;
    int pres = -1;
    for (int j = 0; j < (M); ++j) {
      if (chmin(cur, abs(sx[i] - cx[j]) + abs(sy[i] - cy[j]))) pres = j;
    }
    cout << pres + 1 << endl;
  }
  return 0;
}
