#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[n], d[n];
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < (int)(m); i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < (int)(n); i++) {
    int ans = 1;
    int min = abs(a[i] - c[0]) + abs(b[i] - d[0]);
    for (int j = 0; j < (int)(m); j++) {
      if (min > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
