#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
std::ostream &operator<<(std::ostream &out, const vector<int> &tgt) {
  string s;
  for (int i = 0; i < tgt.size(); i++) {
    s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
  }
  out << s;
  return out;
}
int main() {
  ll n, m, x, y;
  cin >> n >> m;
  vector<ll> a, b, c, d;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    a.push_back(x);
    b.push_back(y);
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    c.push_back(x);
    d.push_back(y);
  }
  for (int i = 0; i < n; i++) {
    ll ans = 1, minm;
    for (int j = 0; j < m; j++) {
      ll man = (a[i] - c[j]) + (b[i] - d[j]);
      if (j == 0)
        minm = man;
      else {
        if (minm > man) {
          minm = man;
          ans = j + 1;
        }
      }
    }
    cout << ans << endl;
  }
}
