#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int inf = 1e8;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N), c(M), d(M), D(N), ans(N);
  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) {
    D[i] = inf;
    for (int j = 0; j < int(M); ++j) {
      int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (D[i] > dis) {
        ans[i] = j + 1;
        D[i] = dis;
      }
    }
  }
  for (int i = 0; i < int(N); ++i) cout << ans[i] << endl;
}
