#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, mini, m_i;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  for (int i = (int)(0); i < (int)(n); ++i) {
    cin >> a[i] >> b[i];
  }
  for (int i = (int)(0); i < (int)(m); ++i) {
    cin >> c[i] >> d[i];
  }
  mini = 1000000;
  for (int j = (int)(0); j < (int)(n); ++j) {
    for (int i = (int)(0); i < (int)(m); ++i) {
      int s = abs(a[j] - c[i]);
      int t = abs(b[j] - d[i]);
      int ans = s + t;
      if (ans < mini) {
        mini = ans;
        m_i = i;
      }
    }
    cout << m_i + 1 << endl;
    mini = 1000000;
  }
}
