#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> a(N), b(N);
  for (int i = 0; i < (N); ++i) cin >> a[i] >> b[i];
  vector<int> c(N), d(N);
  for (int j = 0; j < (M); ++j) cin >> c[j] >> d[j];
  for (int i = 0; i < (N); ++i) {
    int min_dist = INF;
    vector<int> dist(M);
    for (int j = 0; j < (M); ++j) {
      dist[j] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      min_dist = min(min_dist, dist[j]);
    }
    for (int j = 0; j < (M); ++j) {
      if (dist[j] == min_dist) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
  return 0;
}
