#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  int a[55] = {};
  int b[55] = {};
  int c[55] = {};
  int d[55] = {};
  int point = 0;
  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];
  }
  int j = 0;
  for (int i = 0; i < n; i++) {
    int mina = 100000;
    for (j = 0; j < m; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < mina) {
        mina = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        point = j;
      }
    }
    cout << point + 1 << endl;
  }
  return 0;
}
