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