#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long a[n][2];
  for (int i = 0; i < n; ++i) {
    cin >> a[i][0] >> a[i][1];
  }
  long long b[m][2];
  for (int i = 0; i < n; ++i) {
    cin >> b[i][0] >> b[i][1];
  }
  for (int i = 0; i < n; ++i) {
    int index = 0;
    long long val = 1e18 + 100000;
    for (int j = 0; j < m; ++j) {
      long long p = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
      if (p < val) {
        val = p;
        index = j;
      }
    }
    cout << index + 1 << endl;
  }
  return 0;
}
