#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
template <typename T>
struct Vect {
  T x, y;
  Vect<T>() : x(0), y(0) {}
  Vect<T>(T a, T b) : x(a), y(b){};
  template <class D>
  explicit Vect<T>(const Vect<D> &v) : x(v.x), y(v.y){};
  Vect<T> operator+(const Vect<T> &v) const {
    return Vect<T>(x + v.x, y + v.y);
  }
  Vect<T> operator-(const Vect<T> &v) const {
    return Vect<T>(x - v.x, y - v.y);
  }
  Vect<T> operator*(T s) const { return Vect<T>(x * s, y * s); }
  Vect<T> operator/(T s) const { return Vect<T>(x / s, y / s); }
  T dot(const Vect<T> &v) const { return x * v.x + y * v.y; }
  T cross(const Vect<T> &v) const { return x * v.y - y * v.x; }
  T cross(const Vect<T> &a, const Vect<T> &b) const {
    return (a - *this).cross(b - *this);
  }
  T norm() const { return hypot(x, y); }
  T dist2() const { return x * x + y * y; }
  Vect<T> unit() const { return *this / norm(); }
  Vect<T> rotCCW(T ang) const {
    return Vect<T>(x * cos(ang) - y * sin(ang), x * sin(ang) + y * cos(ang));
  }
};
using Vec = Vect<double>;
using Poly = vector<Vec>;
double getArea(const Poly &P) {
  int n = P.size();
  double ans = 0;
  for (int i = 0; i < n; i++) {
    int ii = (i + 1) % n;
    ans += P[i].cross(P[ii]);
  }
  ans /= 2.0;
  return ans;
}
const double EPS = 1e-9;
bool EQ(double x, double y) { return fabs(x - y) < EPS; }
bool LE(double x, double y) {
  if (EQ(x, y)) return true;
  return x < y;
}
bool onSegment(Vec s, Vec e, Vec p) {
  return p.cross(s, e) == 0 && (s - p).dot(e - p) <= 0;
}
bool inPolygon(vector<Vec> &p, Vec a, bool strict = false) {
  int cnt = 0, n = p.size();
  for (int i = 0; i < n; i++) {
    Vec q = p[(i + 1) % n];
    if (onSegment(p[i], q, a)) return !strict;
    cnt ^= ((a.y < p[i].y) - (a.y < q.y)) * a.cross(p[i], q) > 0;
  }
  return cnt;
}
vector<Vec> circleLine(Vec c, double r, Vec a, Vec b) {
  Vec ab = b - a;
  if (EQ(0.0, ab.dist2())) return {};
  Vec p = a + ab * ((c - a).dot(ab) / ab.dist2());
  double s = a.cross(b, c), h2 = r * r - s * s / ab.dist2();
  if (h2 < 0) return {};
  if (EQ(h2, 0)) return {p};
  Vec h = ab.unit() * sqrt(h2);
  return {p - h, p + h};
}
bool intersect(Poly &P, double x, double y, double r) {
  Vec cen(x, y);
  if (inPolygon(P, cen)) return true;
  for (auto &p : P) {
    if (LE((cen - p).norm(), r)) {
      return true;
    }
  }
  const int n = P.size();
  for (int i = 0; i < n; i++) {
    int ii = i == 0 ? n - 1 : i - 1;
    auto cur = circleLine(cen, r, P[i], P[ii]);
    for (auto p : cur) {
      if (EQ((p - P[i]).norm() + (p - P[ii]).norm(), (P[i] - P[ii]).norm())) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  float W, H;
  int n;
  scanf("%f %f %d\n", &W, &H, &n);
  vector<Poly> polys;
  vector<double> areas;
  for (int i = 0; i < n; i++) {
    int sz;
    scanf("%d", &sz);
    polys.emplace_back(sz);
    for (auto &pt : polys.back()) {
      float x, y;
      scanf("%f %f", &x, &y);
      pt.x = x;
      pt.y = y;
    }
    areas.push_back(getArea(polys.back()));
  }
  int q;
  scanf("%d", &q);
  cout << setprecision(10) << fixed;
  while (q--) {
    float x, y, r;
    scanf("%f%f%f", &x, &y, &r);
    double ans = 0;
    VI buy;
    for (int i = 0; i < n; i++) {
      if (intersect(polys[i], x, y, r)) {
        ans += areas[i];
        buy.push_back(i);
      }
    }
    printf("%lf %lu", ans, buy.size());
    for (int i : buy) printf(" %d", i);
    printf("\n");
  }
  return 0;
}
