#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1},
          dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template <typename T>
void print(const std::vector<T>& v, char sep = ' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << '\n';
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int stx[n], sty[n], cx[m], cy[m];
  for (int i = (0); i < (int)(n); ++i) {
    cin >> stx[i] >> sty[i];
  }
  for (int i = (0); i < (int)(m); ++i) {
    cin >> cx[i] >> cy[i];
  }
  for (int i = (0); i < (int)(n); ++i) {
    int dis = 100000000;
    int res;
    for (int j = (0); j < (int)(m); ++j) {
      int num = abs(stx[i] - cx[j]) + abs(sty[i] - cy[j]);
      if (dis > num) {
        dis = num;
        res = j + 1;
      }
    }
    cout << res << '\n';
  }
}
