#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  long long n, m;
  cin >> n >> m;
  pair<long long, long long> stu[n];
  for (int i = 0; i < n; i++) {
    long long ai, bi;
    cin >> ai >> bi;
    stu[i] = make_pair(ai, bi);
  }
  pair<long long, long long> po[m];
  for (int i = 0; i < m; i++) {
    long long ai, bi;
    cin >> ai >> bi;
    po[i] = make_pair(ai, bi);
  }
  for (int i = 0; i < n; i++)
    cout << stu[i].first << " " << stu[i].second << endl;
  for (int i = 0; i < m; i++)
    cout << po[i].first << " " << po[i].second << endl;
  for (int i = 0; i < n; i++) {
    int ans = 1;
    long long mindis = 10000000000;
    for (int j = 0; i < m; j++) {
      long long disi =
          abs(stu[i].first - po[j].first) + abs(stu[i].second - po[j].second);
      if (disi < mindis) {
        mindis = disi;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
