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