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