#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long a[n], b[n], c[m], d[m];
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < (int)(m); i++) {
    cin >> c[i] >> d[i];
  }
  long long ans[n];
  for (int i = 0; i < (int)(n); i++) {
    long long kyori = 2 * pow(10, 8) + 1;
    int num = 0;
    for (int j = 0; j < (int)(m); j++) {
      long long man = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (man < kyori) {
        kyori = man;
        num = j + 1;
      }
    }
    ans[i] = num;
  }
  for (int i = 0; i < (int)(n); i++) cout << ans[i] << endl;
}
