#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, a, b, c, d;
  cin >> n >> m;
  std::deque<long long int> X;
  std::deque<long long int> Y;
  for (int i = 0; i < n; i++) {
    cin >> a;
    X.emplace_back(a);
    cin >> b;
    Y.emplace_back(b);
  }
  std::deque<long long int> x;
  std::deque<long long int> y;
  for (int j = 0; j < m; j++) {
    cin >> c;
    x.emplace_back(c);
    cin >> d;
    y.emplace_back(d);
  }
  for (int k = 0; k < n; k++) {
    long long int min = 600000001;
    int ans;
    for (int l = 0; l < m; l++) {
      long long int tmp = abs(X[k] - x[l]) + abs(Y[k] - y[l]);
      cout << tmp << endl;
      if (tmp < min) {
        min = tmp;
        ans = l + 1;
      }
    }
    cout << ans << endl;
  }
}
