#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m);
  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];
  for (int i = 0; i < (int)(n); ++i) {
    int ans = 1;
    int mm = 100000000;
    for (int j = 0; j < (int)(m); ++j) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < mm) {
        mm = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
