#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
const long long mod = 1e9 + 7;
template <class T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N = in(), M = in();
  vector<pair<int, int>> second(N);
  vector<pair<int, int>> C(N);
  for (long long(i) = 0; (i) < (N); (i)++) {
    second[i].first = in();
    second[i].second = in();
  }
  for (long long(i) = 0; (i) < (M); (i)++) {
    C[i].first = in();
    C[i].second = in();
  }
  for (long long(i) = 0; (i) < (N); (i)++) {
    int dist = INT32_MAX;
    int num = INT32_MAX;
    for (long long(l) = 0; (l) < (M); (l)++) {
      if (abs(second[i].first - C[l].first) +
              abs(second[i].second - C[l].second) <
          dist) {
        dist = abs(second[i].first - C[l].first) +
               abs(second[i].second - C[l].second);
        num = l;
      }
    }
    cout << num + 1 << "\n";
  }
}
