#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int c[m], d[m];
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    int min = 1e8 * 2 + 1, index;
    for (int j = 0; j < m; j++) {
      if (abs(c[j] - a[i]) + abs(d[j] - b[i]) < min) {
        min = abs(c[j] - a[i]) + abs(d[j] - b[i]);
        index = j + 1;
      }
    }
    cout << index << endl;
  }
}
