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