#include <bits/stdc++.h>
using namespace std;
long long a[55], b[55], c[55], d[55];
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (long long i = 0; i < n; i++) {
    long long dis = 1145141191919, num = -1;
    for (long long j = 0; j < n; j++) {
      long long di = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis > di) {
        dis = di;
        num = j;
      }
    }
    cout << num + 1 << endl;
  }
}
