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