#include <bits/stdc++.h>
using namespace std;
int dist(int a, int b, int c, int d) { return abs(a - c) + abs(b - d); }
int main() {
  int n, m;
  cin >> n >> m;
  int *a = new int[n];
  int *b = new int[n];
  int *c = new int[m];
  int *d = new int[m];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < m; j++) {
    cin >> c[j] >> d[j];
  }
  int min = 100000;
  int index;
  for (int i = 0; i < n; i++) {
    min = 100000;
    for (int j = 0; j < m; j++) {
      if (dist(a[i], b[i], c[j], d[j]) < min) {
        min = dist(a[i], b[i], c[j], d[j]);
        index = j + 1;
      }
    }
    cout << index << endl;
  }
  return 0;
}
