#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[n], d[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int j = 0; j < m; j++) cin >> c[j] >> d[j];
  int min[n], ans[n], dis;
  for (int i = 0; i < n; i++) {
    min[i] = 1000000000;
    for (int j = 0; j < m; j++) {
      dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis < min[i]) {
        min[i] = dis;
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
