#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[50] = {}, b[50] = {};
  long long c[50] = {}, d[50] = {};
  for (long long i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 0; i < M; i++) {
    cin >> c[i] >> d[i];
  }
  for (long long i = 0; i < N; i++) {
    long long min = 1 << 21;
    long long cp = 0;
    for (long long j = 0; j < M; j++) {
      long long X = a[i] - c[j];
      long long Y = b[i] - d[j];
      X = (X < 0) ? -X : X;
      Y = (Y < 0) ? -Y : Y;
      if (min > X + Y) {
        min = X + Y;
        cp = j + 1;
      }
    }
    cout << cp << endl;
  }
  return 0;
}
