#include <bits/stdc++.h>
using namespace std;
template <class T>
bool contain(const std::string &s, const T &v) {
  return s.find(v) != std::string::npos;
}
unsigned long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  long long a[55] = {}, b[55] = {}, c[55] = {}, d[55] = {};
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    long long vmin = 1e8 + 5;
    int checkpoint = 0;
    for (int j = 0; j < m; j++) {
      long long value = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (vmin > value) {
        vmin = value;
        checkpoint = j + 1;
      }
    }
    cout << checkpoint << endl;
  }
}
