#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-7;
const int inf = 1e8;
const long long INF = 1e16;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > in(n);
  for (int i = 0; i < n; i++) cin >> in[i].first >> in[i].second;
  vector<pair<int, int> > q(m);
  for (int i = 0; i < m; i++) cin >> q[i].first >> q[i].second;
  for (int i = 0; i < n; i++) {
    int mi = inf, out;
    for (int j = 0; j < m; j++) {
      int t = abs(q[j].first - in[i].first) + abs(q[j].second - in[i].second);
      if (mi > t) {
        mi = t;
        out = j + 1;
      }
    }
    cout << out << endl;
  }
}
