#include <bits/stdc++.h>
std::istream& operator>>(std::istream& input, __int128_t& value) {
  long long tmp;
  input >> tmp;
  value = tmp;
  return input;
}
std::ostream& operator<<(std::ostream& output, const __int128_t value) {
  output << (long long)value;
  return output;
}
void printvec(const std::vector<int>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    std::cout << vec[i] << " ";
  }
  std::cout << std::endl;
}
const int MAX_N = 60;
int N, M;
int a[MAX_N], b[MAX_N], c[MAX_N], d[MAX_N];
int main(int argc, char** argv) {
  std::cin >> N >> M;
  for (int64_t i = (1); i <= (N); i++) {
    std::cin >> a[i] >> b[i];
  }
  for (int64_t i = (1); i <= (M); i++) {
    std::cin >> c[i] >> d[i];
  }
  for (int64_t i = (1); i <= (N); i++) {
    int ret = 1;
    int dist = abs(a[i] - c[1]) + abs(b[i] - d[i]);
    for (int64_t j = (2); j <= (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]);
        ret = j;
      }
    }
    std::cout << ret << std::endl;
  }
  return 0;
}
