#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[n], d[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    int index = -1;
    int dist = INT_MAX;
    for (int j = 0; j < m; j++) {
      int tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist > tmp) {
        dist = tmp;
        index = j + 1;
      }
    }
    cout << index << endl;
  }
  return 0;
}
