#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000001;
const double PI = 3.141592653589;
const long long LMAX = 1000000000000001;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  while ((a % b) != 0) {
    a = b;
    b = a % b;
  }
  return b;
}
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > ab(n);
  vector<pair<int, int> > cd(m);
  for (int i = 0; i < n; i++) cin >> ab[i].first >> ab[i].second;
  for (int i = 0; i < n; i++) cin >> cd[i].first >> cd[i].second;
  for (int i = 0; i < n; i++) {
    int goal = INF;
    int id;
    for (int j = 0; j < m; j++) {
      int d = abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second);
      if (goal > d) {
        goal = d;
        id = j + 1;
      }
    }
    cout << id << endl;
  }
  return 0;
}
