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