#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  for (size_t i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (size_t i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int kyori = 0;
  int ans = 0;
  int ans_value = 999999999;
  for (size_t i = 0; i < n; i++) {
    for (size_t j = 0; j < m; j++) {
      kyori = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (kyori < ans_value) {
        ans_value = kyori;
        ans = j + 1;
      }
    }
    cout << ans << endl;
    ans_value = 99999999;
    ans = 0;
  }
  return 0;
}
