#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const long long INFLL = 1001001001001001001;
const int MOD = (int)1e9 + 7;
const long long MODLL = (long long)1e9 + 7;
const double EPS = 1e-9;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  for (int i = 0; i < (n); ++i) cin >> a[i] >> b[i];
  vector<long long> c(m);
  vector<long long> d(m);
  for (int i = 0; i < (m); ++i) cin >> c[i] >> d[i];
  for (long long i = 0; i < n; i++) {
    long long point = 0;
    long long len = INF;
    for (long long j = 0; j < m; j++) {
      if (len > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        point = j;
        len = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << ++point << endl;
  }
  return 0;
}
