#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> va;
  vector<long long> vb;
  vector<long long> vc;
  vector<long long> vd;
  for (long long i = (0); i < (n); ++i) {
    long long a, b;
    cin >> a >> b;
    va.push_back(a);
    vb.push_back(b);
  }
  for (long long i = (0); i < (n); ++i) {
    long long c, d;
    cin >> c >> d;
    vc.push_back(c);
    vd.push_back(d);
  }
  for (long long i = (0); i < (va.size()); ++i) {
    long long mn = 1000000000000LL;
    for (long long j = (0); j < (vc.size()); ++j) {
      long long a = abs(va[i] - vc[j]) + abs(vb[i] - vd[j]);
      mn = min(a, mn);
    }
    for (long long j = (0); j < (vc.size()); ++j) {
      long long a = abs(va[i] - vc[j]) + abs(vb[i] - vd[j]);
      if (a == mn) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
  return 0;
}
