#include <bits/stdc++.h>
using namespace std;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, -1, 0, 1};
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> as, bs, cs, ds;
  for (int i = 0; i < (N); i++) {
    int a, b;
    cin >> a >> b;
    as.push_back(a);
    bs.push_back(b);
  }
  for (int i = 0; i < (M); i++) {
    int c, d;
    cin >> c >> d;
    cs.push_back(c);
    ds.push_back(d);
  }
  vector<int> ans;
  for (int i = 0; i < (N); i++) {
    long long min_dist = LL_INF;
    int point = -1;
    for (int j = 0; j < (M); j++) {
      long long x = as[i] - cs[j];
      long long y = bs[i] - ds[j];
      long long dist = x * x + y * y;
      if (min_dist > dist) {
        min_dist = dist;
        point = j;
      }
    }
    ans.push_back(point + 1);
  }
  for (auto &a : ans) {
    cout << a << endl;
  }
  return 0;
}
