#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n][2], b[m][2];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1];
  }
  for (long long int i = 0; i < m; i++) {
    cin >> b[i][0] >> b[i][1];
  }
  vector<long long int> v;
  long long int mx = 123456789;
  long long int ind = 0;
  for (long long int i = 0; i < n; i++) {
    mx = 123456789;
    ind = 0;
    for (long long int j = 0; j < m; j++) {
      long long int diff = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
      if (diff < mx) {
        mx = diff;
        ind = j + 1;
      }
    }
    v.push_back(ind);
  }
  for (long long int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
