#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
signed main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  for (ll i = 0; i < ll(n); i++) {
    cin >> a[i] >> b[i];
  }
  for (ll i = 0; i < ll(n); i++) {
    cin >> c[i] >> d[i];
  }
  int dif_min = 1000000007;
  int count;
  for (ll i = 0; i < ll(n); i++) {
    dif_min = 1000000007;
    for (ll j = 0; j < ll(m); j++) {
      if (dif_min > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        count = j + 1;
        dif_min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << count << endl;
  }
  return 0;
}
