#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<long long, long long>> g;
  vector<pair<long long, long long>> point;
  int a, b;
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    g.push_back(make_pair(a, b));
  }
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    point.push_back(make_pair(a, b));
  }
  for (int i = 0; i < N; i++) {
    vector<pair<long long, int>> dis;
    for (int j = 0; j < M; j++) {
      long long d = abs((g[i].first - point[j].first)) +
                    abs((g[i].second - point[j].second));
      dis.push_back(make_pair(d, j + 1));
    }
    sort(dis.begin(), dis.end());
    cout << dis[0].second << endl;
  }
}
