#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
long long int n, m;
vector<pair<long long int, long long int> > a, b;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  a.resize(n);
  b.resize(m);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < (int)(m); i++) {
    cin >> b[i].first >> b[i].second;
  }
  for (int i = 0; i < (int)(m); i++) {
    long long int index = 0;
    long long int min = 99999999999;
    for (int j = 0; j < (int)(n); j++) {
      if (abs(b[i].first - a[j].first) + abs(b[i].second - a[j].second) < min) {
        index = j;
        min = abs(b[i].first - a[j].first) + abs(b[i].second - a[j].second);
      }
    }
    cout << index + 1 << endl;
  }
  return 0;
}
