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