#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> v1(N, vector<int>(2));
  vector<vector<int>> v2(M, vector<int>(2));
  for (int i = 0; i < N; i++) {
    cin >> v1.at(i).at(0) >> v1.at(i).at(1);
  }
  for (int j = 0; j < N; j++) {
    cin >> v2.at(j).at(0) >> v2.at(j).at(1);
  }
  for (int i = 0; i < N; i++) {
    int ans, count = 1000000000;
    for (int j = 0; j < M; j++) {
      int count2;
      int x = v1.at(i).at(0) - v2.at(j).at(0),
          y = v1.at(i).at(1) - v2.at(j).at(1);
      if (x < 0) {
        x *= -1;
      }
      if (y < 0) {
        y *= -1;
      }
      count2 = x + y;
      if (count2 < count) {
        count = count2;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
