#include <bits/stdc++.h>
using namespace std;
int n, m;
long long x[55], y[55];
int p[55];
int main() {
  int i, j;
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (i = 1; i <= m; i++) {
    long long xx, yy;
    cin >> xx >> yy;
    int k = 0;
    long long t = 1e18;
    t *= 4;
    for (j = 1; j <= n; j++) {
      if (t > abs(xx - x[j]) + abs(yy - y[j])) {
        t = abs(xx - x[j]) + abs(yy - y[j]);
        k = j;
      }
    }
    p[k] = i;
  }
  for (i = 1; i <= n; i++) cout << p[i] << '\n';
  return 0;
}
