#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;
const int32 INF = 1e9;
const int32 MOD = 1e9 + 7;
const int64 LLINF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n, m;
  cin >> n >> m;
  vector<complex<int64>> ab(n), cd(m);
  for (int64 i = 0; i < (n); ++i) {
    int32 a, b;
    cin >> a >> b;
    ab[i] = complex<int64>(a, b);
  }
  for (int64 i = 0; i < (m); ++i) {
    int32 c, d;
    cin >> c >> d;
    cd[i] = complex<int64>(c, d);
  }
  for (int64 i = 0; i < (n); ++i) {
    int32 mn = LLINF;
    int32 ans = -1;
    for (int64 j = 0; j < (m); ++j) {
      if (norm(ab[i] - cd[j]) < mn) {
        mn = norm(ab[i] - cd[j]);
        ans = j + 1;
      }
    }
    cout << (ans) << "\n";
  }
  return 0;
}
