#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int ax[100], bx[100], ay[100], by[100];
  int tmp;
  int ans[100];
  int ans2[100];
  for (int i = 0; i < 100; i++) {
    ans[i] = 100000001;
  }
  for (int i = 0; i < n; i++) {
    cin >> ax[i] >> ay[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> bx[i] >> by[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      tmp = abs(ax[i] - bx[j]) + abs(ay[i] - by[j]);
      if (tmp < ans[i]) {
        ans[i] = tmp;
        ans2[i] = j;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans2[i] + 1 << endl;
  }
  return 0;
}
