#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  int i, j, ans = 0;
  for (i = 0; i < n; i++) {
    long long search = 10000005;
    for (j = 0; j < m; j++) {
      long long manhattan = fabs(a[i] - c[j]) + fabs(b[i] - d[j]);
      if (search > manhattan) {
        search = manhattan;
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
