#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[1000], b[1000], c[1000], d[1000];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int shu;
  for (int i = 0; i < n; i++) {
    int man = 99999999;
    for (int j = 0; j < m; j++) {
      if (man > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        man = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        shu = j;
      }
    }
    cout << shu + 1 << endl;
  }
}
