#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int man[n][2], po[m][2];
  for (int i = 0; i < n; i++) {
    cin >> man[i][0] >> man[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> po[i][0] >> po[i][1];
  }
  long long int ans[n], count;
  count = 100000000000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (count > abs(man[i][0] - po[j][0]) + abs(man[i][1] - po[j][1])) {
        count = abs(man[i][0] - po[j][0]) + abs(man[i][1] - po[j][1]);
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
}
