#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int a[50], b[50];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int c[50], d[50];
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  long long x, y;
  vector<vector<long long> > ans(n, vector<long long>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i] > c[j]) {
        x = (long long)a[i] - c[j];
      } else {
        x = (long long)c[j] - a[i];
      }
      if (b[i] > d[j] > 0) {
        y = (long long)b[i] - d[j];
      } else {
        y = (long long)d[j] - b[i];
      }
      ans[i][j] = x + y;
    }
  }
  int tmp;
  for (int i = 0; i < n; i++) {
    long long mini = LLONG_MAX;
    for (int j = 0; j < n; j++) {
      if (mini > ans[i][j]) {
        mini = ans[i][j];
        tmp = j;
      }
    }
    cout << tmp + 1 << endl;
  }
  return 0;
}
