#include <bits/stdc++.h>
using namespace std;
int N, M;
long long a[50], b[50], c[50], d[50];
int main() {
  cin >> N >> M;
  for (int i = 0; i < (N); ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < (M); ++i) cin >> c[i] >> d[i];
  long long ans[50];
  for (int i = 0; i < (N); ++i) {
    int target = 100000000;
    int idx = -1;
    for (int j = 0; j < (M); ++j) {
      long long dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (target > dist) {
        target = dist;
        idx = j;
      }
    }
    cout << idx + 1 << endl;
  }
}
