#include <bits/stdc++.h>
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
using namespace std;
using v = vector<int>;
using ll = long long;
template <class T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
int main(int argc, char *argv[]) {
  int n, m;
  cin >> n >> m;
  int a, b, c, d;
  vector<int> A(n), B(n), C(m), D(m);
  int mx = INF, my = INF;
  for (int i = 0; i < (int)n; i++) cin >> A[i] >> B[i];
  for (int i = 0; i < (int)m; i++) cin >> C[i] >> D[i];
  int res, pre, cnt;
  for (int i = 0; i < (int)n; i++) {
    pre = abs(A[i] - C[0]) + abs(B[i] - D[0]);
    cnt = 1;
    for (int j = 0; j < (int)m; j++) {
      res = abs(A[i] - C[j]) + abs(B[i] - D[j]);
      if (mx >= res) {
        cnt = j + 1;
        mx = res;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
