#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n);
  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int nearcheck = 0;
  int mindist = 400000000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mindist > (abs(a[i] - c[j]) + abs(b[i] - d[j]))) {
        mindist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        nearcheck = j;
      }
    }
    cout << nearcheck + 1 << endl;
    mindist = 400000000;
    nearcheck = 0;
  }
}
