#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 57;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, -0};
const int DX[8] = {-1, -1, -1, 0, 1, 1, 1, 0},
          DY[8] = {1, 0, -1, -1, -1, 0, 1, 1};
int n, m;
vector<int> x, y, X, Y;
int main() {
  cin >> n >> m;
  x = y = vector<int>(n);
  X = Y = vector<int>(m);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < m; i++) cin >> X[i] >> Y[i];
  for (int i = 0; i < n; i++) {
    int m = inf, res;
    for (int j = 0; j < m; j++) {
      int t = abs(x[i] - X[j]) + abs(y[i] - Y[j]);
      if (m > t) {
        m = t;
        res = j + 1;
      }
    }
    cout << res << endl;
  }
}
