#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000000LL;
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 main() {
  int n, m;
  cin >> n >> m;
  vector<pii> St(n), M(n);
  for (int i = 0; i < (n); i++) {
    int a, b;
    cin >> a >> b;
    St[i] = (pii(a, b));
  }
  for (int i = 0; i < (m); i++) {
    int c, d;
    cin >> c >> d;
    M[i] = (pii(c, d));
  }
  for (int i = 0; i < (n); i++) {
    int res = -1, minD = INF;
    for (int j = 0; j < (m); j++) {
      int x = abs(M[j].first - St[i].first);
      int y = abs(M[j].second - St[i].second);
      if (minD > x + y) {
        minD = x + y;
        res = j + 1;
      }
    }
    cout << res << ln;
  }
}
