#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, num[51] = {};
  long long a[51], b[51], c[51], d[51], minl, l;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 1; i <= n; i++) {
    minl = 10000000;
    for (int j = 1; j <= m; j++) {
      l = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (minl > l) {
        minl = l;
        num[i] = j;
      }
    }
    cout << num[i] << endl;
  }
}
