#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[50], b[50], c[50], d[50];
  int o;
  int s;
  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++) {
    o = 1000000000;
    for (int j = 0; j < n; j++) {
      if (abs(c[j] - a[i]) + abs(d[j] - b[i]) < o) {
        o = abs(c[j] - a[i]) + abs(d[j] - b[i]);
        s = j + 1;
      }
    }
    cout << s << endl;
  }
  return 0;
}
