#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 5;
const int MOD = 1e9 + 7;
const long long INF = 1061109567;
const long double EPS = 1e-9;
const long double PI = acos(-1);
int distM(pair<int, int> x, pair<int, int> y) {
  return abs(x.first - y.first) + abs(x.second - y.second);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > second(N), c(M);
  for (auto& x : second) cin >> x.first >> x.second;
  for (auto& x : c) cin >> x.first >> x.second;
  bitset<MX> mk;
  for (int i = (0); i < (N); i++) {
    pair<int, int> res = {-1, INF};
    for (int j = (0); j < (M); j++) {
      if (mk[j]) continue;
      if (distM(second[i], c[j]) < res.second) {
        res.second = distM(second[i], c[j]);
        res.first = j;
      }
    }
    mk[res.first] = 1;
    cout << res.first + 1 << "\n";
  }
}
