#include <bits/stdc++.h>
using namespace std;
int f(long int a, long int b, long int c, long int d) {
  return max(a, c) + max(b, d) - min(a, c) - min(b, d);
}
int main() {
  long int N, M, x;
  cin >> N >> M;
  vector<long int> a(N), b(N), c(M), d(M);
  for (int i = 0; i < N; i++) cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < M; i++) cin >> c.at(i) >> d.at(i);
  for (int i = 0; i < N; i++) {
    x = 0;
    for (int j = 1; j < M; j++) {
      if (f(a.at(i), b.at(i), c.at(x), d.at(x)) >
          f(a.at(i), b.at(i), c.at(j), d.at(j)))
        x = j;
    }
    cout << x << endl;
  }
}
