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