#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  y /= gcd(x, y);
  return (x * y);
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> xs(n), ys(n), xg(m), yg(m), dis(n), place(n);
  for (int i = 0; i < n; i++) cin >> xs[i] >> ys[i];
  for (int i = 0; i < m; i++) cin >> xg[i] >> yg[i];
  for (int i = 0; i < n; i++) {
    dis[i] = 1000000000000000000LL;
    place[i] = 1000000000000000000LL;
    for (int j = 0; j < m; j++) {
      if (dis[i] > abs(xs[i] - xg[j]) + abs(ys[i] + yg[j])) {
        dis[i] = abs(xs[i] - xg[j]) + abs(ys[i] - yg[j]);
        place[i] = j + 1;
      }
    }
    cout << place[i] << endl;
  }
  return 0;
}
