#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> ab(n, vector<long long>(2));
  for (long long i = 0; i < n; i++) cin >> ab[i][0] >> ab[i][1];
  vector<vector<long long>> cd(n, vector<long long>(2));
  for (long long i = 0; i < m; i++) cin >> cd[i][0] >> cd[i][1];
  vector<vector<long long>> idx_dist(n, vector<long long>(2));
  for (long long i = 0; i < n; i++) {
    long long min_idx;
    long long min_dist = LINF;
    for (long long j = 0; j < m; j++) {
      long long temp_dist = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]);
      if (temp_dist == min_dist) {
        continue;
      } else if (min(min_dist, temp_dist) == temp_dist) {
        min_dist = temp_dist;
        min_idx = j;
      }
    }
    idx_dist[i][0] = min_idx;
    idx_dist[i][1] = min_dist;
  }
  for (long long i = 0; i < n; i++) cout << idx_dist[i][0] + 1 << endl;
}
