#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> c[i] >> d[i];
  }
  long long md, p;
  for (int i = 1; i <= n; i++) {
    long long mp = 1e8;
    for (int j = 1; j <= m; j++) {
      md = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (mp > md) {
        mp = md;
        p = j;
      }
    }
    cout << p << endl;
  }
}
