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