#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io {
  io() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
};
const int INF = INT_MAX;
const long long int LLINF = 1LL << 60;
const long long int MOD = 1000000007;
const double EPS = 1e-9;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(n);
  int a, b;
  for (int i = 0; i < (n); ++i) {
    cin >> a >> b;
    v[i] = make_pair(a, b);
  }
  vector<pair<int, int> > w(n);
  for (int i = 0; i < (m); ++i) {
    cin >> a >> b;
    w[i] = make_pair(a, b);
  }
  for (int i = 0; i < (n); ++i) {
    int ans = 1;
    int dis = INF;
    for (int j = 0; j < (m); ++j) {
      int dist = abs(v[i].second - w[j].second) + abs(v[i].first - w[j].first);
      if (dis > dist) {
        dis = dist;
        ans = j + 1;
      } else if (dis == dist) {
        ans = min(ans, j + 1);
      }
    }
    cout << (ans) << '\n';
  }
}
