#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > stu, pnt;
vector<vector<pair<long long, int> > > sol;
int const N = 51;
bool vis[N];
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  while (n--) {
    cin >> a >> b;
    stu.push_back({a, b});
  }
  n = stu.size();
  while (m--) {
    cin >> a >> b;
    pnt.push_back({a, b});
  }
  m = pnt.size();
  sol.resize(n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      sol[i].push_back({abs(stu[i].first - pnt[j].first) +
                            abs(stu[i].second - pnt[j].second),
                        j});
  for (int i = 0; i < n; i++) sort(sol[i].begin(), sol[i].end());
  sort(sol.begin(), sol.end());
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (vis[sol[i][j].second]) j++;
    vis[sol[i][j].second] = true;
    cout << sol[i][j].second + 1 << endl;
  }
  return 0;
}
