#include <bits/stdc++.h>
using namespace std;
int xcomp(vector<long long int>& a, vector<long long int>& b) {
  return a[0] < b[0];
}
long long int mod = 1000000007;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<vector<long long int>> v(N, vector<long long int>(2, 0));
  vector<vector<long long int>> vv(N, vector<long long int>(2, 0));
  for (long long int i = (0); i < (N); ++i) {
    cin >> v[i][0] >> v[i][1];
  }
  for (long long int i = (0); i < (M); ++i) {
    cin >> vv[i][0] >> vv[i][1];
  }
  for (long long int i = (0); i < (N); ++i) {
    long long int min = 900000000;
    long long int flag = 0;
    for (long long int j = (0); j < (M); ++j) {
      long long int sum = 0;
      if (v[i][0] - vv[j][0] > 0) {
        sum += (v[i][0] - vv[j][0]);
      } else {
        sum -= (v[i][0] - vv[j][0]);
      }
      if (v[i][1] - vv[j][1] > 0) {
        sum += (v[i][1] - vv[j][1]);
      } else {
        sum -= (v[i][1] - vv[j][1]);
      }
      if (min > sum) {
        min = sum;
        flag = j + 1;
      }
    }
    cout << flag << endl;
  }
}
