#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int a[n], b[n], minimum[n], ans[n], x[m], y[m];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    ans[i] = 0;
    minimum[i] = 2 * 100000000;
  }
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);
      if (minimum[i] > man_dis) {
        ans[i] = j + 1;
        minimum[i] = man_dis;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << '\n';
}
