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