#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int a[N], b[N], c[N], d[N];
  int i, j;
  for (i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (i = 0; i < N; i++) {
    cin >> c[i] >> d[i];
  }
  long long ans, ansx, ansy, distance, tempdistance, tempx, tempy;
  for (i = 0; i < N; i++) {
    ansx = labs(a[i] - c[0]);
    ansy = labs(b[i] - d[0]);
    distance = ansx + ansy;
    ans = 1;
    for (j = 0; j < N; j++) {
      tempx = labs(a[i] - c[j]);
      tempy = labs(b[i] - d[j]);
      tempdistance = tempx + tempy;
      if (distance > tempdistance) {
        distance = tempdistance;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
