#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1 << 30;
const double EPS = 1e-10;
const double pi = 3.14159265359;
int n, m;
int a[55], b[55], c[55], d[55];
int main() {
  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];
  }
  for (int i = 0; i < n; i++) {
    int D = INF;
    int CP = 0;
    for (int j = 0; j < m; j++) {
      if (D > (abs(a[i] - c[j]) + abs(b[i] - d[j]))) {
        CP = j;
      }
    }
    cout << CP + 1 << endl;
  }
  return 0;
}
