#include <bits/stdc++.h>
using namespace std;
void printVec(std::vector<int>& vec) {
  std::cout << "";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    std::cout << *it << " ";
  }
  std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
  std::cout << "";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    std::cout << *it << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
int vector_finder(std::vector<string> vec, string number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return 1;
  } else {
    return 0;
  }
}
std::vector<std::string> StringSplit(const std::string& str, char sep) {
  std::vector<std::string> v;
  std::stringstream ss(str);
  std::string buffer;
  while (std::getline(ss, buffer, sep)) {
    v.push_back(buffer);
  }
  return v;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m), pos(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int min, distance;
  for (int i = 0; i < n; i++) {
    min = 10000;
    for (int j = 0; j < m; j++) {
      distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (distance < min) {
        min = distance;
        pos[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << pos[i] << endl;
  }
  cout << endl;
  return 0;
}
