#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long int, long long int> > seito, point;
  for (int i = 0; i < (int)(n); i++) {
    long long int a, b;
    cin >> a >> b;
    seito.push_back(make_pair(a, b));
  }
  for (int i = 0; i < (int)(m); i++) {
    long long int c, d;
    cin >> c >> d;
    point.push_back(make_pair(c, d));
  }
  for (int i = 0; i < (int)(n); i++) {
    int ans = 0;
    int old = 0;
    for (int j = 0; j < (int)(m); j++) {
      int dis = abs(seito[i].first - point[j].first) +
                abs(seito[i].second - point[j].second);
      if (j == 0) {
        old = dis;
      } else {
        if (old > dis) {
          old = dis;
          ans = j;
        }
      }
    }
    cout << ans << endl;
  }
}
