#include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T min(T a, T b, T c, T d) {
  return min(a, min(b, min(c, d)));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
T max(T a, T b, T c, T d) {
  return max(a, max(b, max(c, d)));
}
bool cmp(const int& a, const int& b) { return a > b; }
pair<long long, long long> a[2000007], b[2000007];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); ++i) scanf("%lld%lld", &a[i].first, &a[i].second);
  for (int i = (1); i <= (m); ++i) scanf("%lld%lld", &b[i].first, &b[i].second);
  for (int i = (1); i <= (n); ++i) {
    long long ans = 4LL * 1000000000000000007LL;
    int pos = 0;
    for (int j = (1); j <= (m); ++j) {
      if (ans > abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second)) {
        ans = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
        pos = j;
      }
    }
    printf("%d\n", pos);
  }
  return 0;
}
