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