#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> st(n);
  vector<int> point(n);
  vector<pair<int, int>> ch(m);
  for (int i = 0; i < (n); ++i) {
    int a, b;
    cin >> a >> b;
    pair<int, int> p;
    p = make_pair(a, b);
    st[i] = p;
  }
  for (int i = 0; i < (m); ++i) {
    int c, d;
    cin >> c >> d;
    pair<int, int> p;
    p = make_pair(c, d);
    ch[i] = p;
  }
  for (int i = 0; i < (n); ++i) {
    pair<int, int> stp = st[i];
    int mandiss = 100;
    int dissnum = 100;
    for (int j = 0; j < (m); ++j) {
      pair<int, int> chp = ch[j];
      int dis = abs(stp.first - chp.first) + abs(stp.second - chp.second);
      if (dis < mandiss) {
        mandiss = dis;
        dissnum = j + 1;
      }
    }
    point[i] = dissnum;
  }
  for (int i = 0; i < (n); ++i) {
    cout << point[i] << endl;
  }
}
