#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int dx4[4] = {1, 0, -1, 0}, dy4[4] = {0, 1, 0, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(n), d(n);
  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 < n; i++) {
    int ans = 100;
    int dist = 1e9;
    for (int j = 0; j < m; j++) {
      int tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist > tmp) {
        dist = tmp;
        ans = j;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
