#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
const double EPS = 1e-11;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m);
  for (int i = 0; i < (int)(n); ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < (int)(m); ++i) cin >> c[i] >> d[i];
  for (int i = 0; i < (int)(n); ++i) {
    int id = -1, di = 1e9;
    for (int j = 0; j < (int)(m); ++j) {
      int dd = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dd < di) id = j;
    }
    printf("%d\n", id + 1);
  }
  return 0;
}
