#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse4,sse4.2,popcnt,abm,mmx,avx")
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T maxs(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T mins(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
const double eps = 1e-6;
int sgn(const double &first) { return first < -eps ? -1 : first > eps; }
pair<double, double> operator-(const pair<double, double> &a,
                               const pair<double, double> &b) {
  return {a.first - b.first, a.second - b.second};
}
pair<double, double> operator*(const pair<double, double> &a, double b) {
  return {a.first * b, a.second * b};
}
double operator*(const pair<double, double> &a, const pair<double, double> &b) {
  return a.first * b.second - b.first * a.second;
}
double operator%(const pair<double, double> &a, const pair<double, double> &b) {
  return a.first * b.first + a.second * b.second;
}
double dis(const pair<double, double> &a) {
  return sqrt(a.first * a.first + a.second * a.second);
}
bool point_in_polygon(vector<pair<double, double> > &p,
                      pair<double, double> O) {
  int ret = 0;
  int n = p.size();
  for (int i = 0; i < n; i++) {
    pair<double, double> u = p[i], v = p[(i + 1) % n];
    if (sgn(u.second - v.second) <= 0) swap(u, v);
    if (sgn(O.second - u.second) > 0 || sgn(O.second - v.second) <= 0) continue;
    ret += sgn((v - O) * (u - O)) > 0;
  }
  return ret & 1;
}
double Area(const vector<pair<double, double> > &fig) {
  double res = 0;
  for (unsigned i = 0; i < fig.size(); i++) {
    pair<double, double> p = i ? fig[i - 1] : fig.back();
    pair<double, double> q = fig[i];
    res += (p.first - q.first) * (p.second + q.second);
  }
  return fabs(res) / 2;
}
double dist(pair<double, double> A, pair<double, double> B,
            pair<double, double> E) {
  pair<double, double> AB = B - A;
  pair<double, double> BE = E - B;
  pair<double, double> AE = E - A;
  double AB_BE, AB_AE;
  AB_BE = AB % BE;
  AB_AE = AB % AE;
  double reqAns = 0;
  if (AB_BE > 0) {
    return dis(E - B);
  } else if (AB_AE < 0) {
    return dis(E - A);
  } else {
    return abs(AB * AE) / (dis(AB));
  }
}
bool check(pair<double, double> cen, double r,
           vector<pair<double, double> > &p) {
  double dis = 1e15;
  int m = (int)p.size();
  for (int i = 0; i < m; i++) {
    mins(dis, dist(p[i], p[(i + 1) % m], cen));
    if (dis <= r || abs(dis - r) < eps) return 1;
  }
  return 0;
}
const int N = 1e6 + 5;
vector<pair<double, double> > poly[N];
double area[N];
double rd() {
  string s;
  cin >> s;
  int k = s.size();
  int p = find(begin(s), end(s), '.') - begin(s);
  if (p == k) {
    long long first = 0;
    for (int i = 0; i < k; i++) {
      first = 10 * first + s[i] - 48;
    }
    return first;
  } else {
    long long first = 0, f = 0, g = 1;
    for (int i = 0; i < p; i++) {
      first = 10 * first + s[i] - 48;
    }
    for (int i = p + 1; i < k; i++) {
      f = 10 * f + s[i] - 48;
      g = 10 * g;
    }
    return double(first * g + f) / g;
  }
}
int solve() {
  double w, h;
  cin >> w >> h;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    vector<pair<double, double> > vec(v);
    for (int j = 0; j < v; j++) {
      vec[j].first = rd();
      vec[j].second = rd();
    }
    area[i] = Area(vec);
    poly[i] = vec;
  }
  int q;
  cin >> q;
  for (int k = 0; k < q; k++) {
    double first, second, r;
    first = rd(), second = rd(), r = rd();
    pair<double, double> cen = {first, second};
    vector<int> temp;
    double ans = 0;
    for (int i = 0; i < n; i++) {
      if (point_in_polygon(poly[i], cen)) {
        ans += area[i];
        temp.push_back(i);
      } else {
        if (check(cen, r, poly[i])) {
          ans += area[i];
          temp.push_back(i);
        }
      }
    }
    cout << ans << " " << (int)temp.size() << " ";
    for (auto i : temp) cout << i << " ";
    cout << "\n";
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
