#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, m;
  cin >> n >> m;
  int student[n][2], checkPoint[m][2];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < 2; ++j) cin >> student[i][j];
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < 2; ++j) cin >> checkPoint[i][j];
  for (int i = 0; i < n; ++i) {
    int manHattan = INT_MAX;
    int index = INT_MAX;
    for (int j = 0; j < m; ++j) {
      int res = abs(student[i][0] - checkPoint[j][0]) +
                abs(student[i][1] - checkPoint[j][1]);
      if (manHattan > res) {
        manHattan = res;
        index = j;
      }
    }
    cout << index << endl;
  }
}
