#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int a[n], b[n], c[m], d[n], ans[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) {
    long long int dist_min = 1000000000;
    for (int j = 0; j < m; ++j) {
      long long int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist < dist_min) {
        dist_min = dist;
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; ++i) cout << ans[i] << '\n';
  return 0;
}
