#include <bits/stdc++.h>
using namespace std;
const long long INF = 200000010;
long long n, m;
long long a[51], b[51], c[51], d[51];
long long ans[51];
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 1; i <= m; i++) {
    cin >> c[i] >> d[i];
  }
  for (long long i = 1; i <= n; i++) {
    long long temp = INF;
    for (long long j = 1; j <= m; j++) {
      long long ret = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (ret < temp) {
        ans[i] = j;
        temp = ret;
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
