#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N), c(M), d(M);
  for (int i = 0; i < (N); i++) cin >> a[i] >> b[i];
  for (int i = 0; i < (M); i++) cin >> c[i] >> d[i];
  for (int i = 0; i < (M); i++) {
    int mn = 1e9, num;
    for (int j = 0; j < (N); j++) {
      int dist = abs(a[j] - c[i]) + abs(b[j] - d[i]);
      if (dist < mn) {
        mn = dist;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
  return 0;
}
