#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int inf = 1e9 + 7;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  pair<long long, long long> students[n];
  pair<long long, long long> checkpoint[n];
  for (int i = (int)(0); i < (int)(n); ++i) {
    long long a, b;
    cin >> a >> b;
    pair<long long, long long> p = make_pair(a, b);
    students[i] = p;
  }
  for (int i = (int)(0); i < (int)(m); ++i) {
    long long c, d;
    cin >> c >> d;
    pair<long long, long long> p = make_pair(c, d);
    checkpoint[i] = p;
  }
  for (int i = (int)(0); i < (int)(n); ++i) {
    int index = inf;
    int min_num = inf;
    for (int j = (int)(0); j < (int)(m); ++j) {
      long long kyori = abs(students[i].first - checkpoint[j].first) +
                        abs(students[i].second - checkpoint[j].second);
      if (kyori < min_num) {
        min_num = kyori;
        index = j;
      }
    }
    cout << index + 1 << endl;
  }
}
