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