#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const long long INF = 1LL << 29;
const long long mod = 1e9 + 7;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  int n = v.size();
  for (int(i) = 0; (i) < (long long)(n); ++(i))
    os << v[i] << (i == n - 1 ? "" : " ");
  return os;
}
int a[60], b[60], c[60], d[60];
int main() {
  int n, m;
  cin >> n >> m;
  for (int(i) = 0; (i) < (long long)(n); ++(i)) cin >> a[i] >> b[i];
  for (int(i) = 0; (i) < (long long)(m); ++(i)) cin >> c[i] >> d[i];
  for (int(i) = 0; (i) < (long long)(n); ++(i)) {
    int r = 0, x = 1e9;
    for (int(j) = 0; (j) < (long long)(m); ++(j)) {
      int t = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      if (t < x) {
        x = t;
        r = j;
      }
    }
    cout << r << endl;
  }
  return 0;
}
