#include <bits/stdc++.h>
using namespace std;
int a[55], b[55], c[55], d[55];
int flag[55];
int ff[55];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  int anspos = 0;
  for (int i = 1; i <= m; i++) {
    cin >> c[i] >> d[i];
    long long mins = 1000000007;
    for (int j = 1; j <= n; j++) {
      if (flag[j]) continue;
      long long s = abs(c[i] - a[j]) + abs(d[i] - b[j]);
      if (mins > s) {
        mins = s;
        anspos = j;
      }
    }
    if (flag[anspos])
      continue;
    else {
      cout << anspos << endl;
      flag[anspos] = 1;
    }
  }
  return 0;
}
