#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
using long long = long long;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void print(const std::vector<int> &v) {
  std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
  std::cout << std::endl;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> a(N), b(N);
  vector<long long> c(M), d(M);
  for (long long i = 0; i < (long long)N; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 0; i < (long long)M; i++) {
    cin >> c[i] >> d[i];
  }
  long long dist = (1ll << 60);
  for (long long i = 0; i < (long long)N; i++) {
    int ans;
    for (long long j = 0; j < (long long)M; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < dist) {
        dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
