#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
int main() {
  int n, m;
  cin >> n >> m;
  int a[100], b[100], c[100], d[100];
  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 p;
  for (int i = 0; i < n; i++) {
    int kyori = INF;
    for (int j = 0; j < m; j++) {
      int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (kyori > dis) {
        kyori = dis;
        p = j;
      }
    }
    cout << p + 1 << endl;
  }
  return 0;
}
