#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long x;
  vector<long long> a, b, c, d;
  cin >> n >> m;
  for (int i = (int)0; i < (int)n; i++) {
    cin >> x;
    a.push_back(x);
    cin >> x;
    b.push_back(x);
  }
  for (int j = (int)0; j < (int)m; j++) {
    cin >> x;
    c.push_back(x);
    cin >> x;
    d.push_back(x);
  }
  for (int i = (int)0; i < (int)n; i++) {
    long ans = 1 << 25;
    int ck = -1;
    for (int j = (int)0; j < (int)m; j++) {
      if (ans > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        ck = j;
        ans = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << (ck + 1) << endl;
    ;
  }
  return 0;
}
