#include <bits/stdc++.h>
using namespace std;
bool desc(long long i, long long j) { return i > j; }
long long x[1000009], y[1000009], xc[1000009], yc[1000009], vis[1000009];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long i = 0, j = 1, t, k, n, l = 0, a = 0, m, b = 0, ans = 0;
  string s;
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (i = 1; i <= m; i++) cin >> xc[i] >> yc[i];
  for (i = 1; i <= n; i++) {
    long long dis = 1e9, ldis, z;
    for (j = 1; j <= m; j++) {
      ldis = abs(xc[j] - x[i]) + abs(yc[j] - y[i]);
      if (dis > ldis && vis[j] == 0) {
        dis = ldis;
        z = j;
      }
    }
    cout << z << endl;
    vis[z] = 1;
  }
  return 0;
}
