#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e7;
const long long MOD = (1e9) + 7;
const long long MAX_N = 1 << 17;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<pair<long long, long long> > n(N);
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    n[i] = pair<long long, long long>(a, b);
  }
  vector<pair<long long, long long> > m(M);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    m[i] = pair<long long, long long>(a, b);
  }
  for (int i = 0; i < N; i++) {
    long long mini = INF;
    long long ans = 0;
    for (int j = 0; j < M; j++) {
      long long cost =
          abs(m[j].first - n[i].first) + abs(m[j].second - n[i].second);
      if (cost < mini) {
        mini = cost;
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
