#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  for (int i = 0; i < (n); i++) cin >> a[i] >> b[i];
  for (int j = 0; j < (m); j++) cin >> c[j] >> d[j];
  int mint = 1e8 + 1;
  int ans = 0;
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (m); j++) {
      if (mint > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        ans = j;
        mint = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << ans + 1 << endl;
    ans = 0;
    mint = 1e8 + 1;
  }
}
