#include <bits/stdc++.h>
using namespace std;
namespace geometry {
constexpr double eps = 1e-8;
inline int sign(double k) {
  if (k > eps)
    return 1;
  else if (k < -eps)
    return -1;
  return 0;
}
inline int cmp(double k1, double k2) { return sign(k1 - k2); }
struct point {
  double x, y;
  explicit point(double x = 0, double y = 0) : x(x), y(y) {}
  bool operator<(point p) const { return tie(x, y) < tie(p.x, p.y); }
  bool operator==(point p) const { return tie(x, y) == tie(p.x, p.y); }
  point operator+(point p) const { return point(x + p.x, y + p.y); }
  point operator-(point p) const { return point(x - p.x, y - p.y); }
  point operator*(double d) const { return point(x * d, y * d); }
  point operator/(double d) const { return point(x / d, y / d); }
  double dot(point p) const { return x * p.x + y * p.y; }
  double cross(point p) const { return x * p.y - y * p.x; }
  double cross(point a, point b) const { return (a - *this).cross(b - *this); }
  double dist2() const { return x * x + y * y; }
  double dist() const { return sqrt((double)dist2()); }
  double angle() const { return atan2(y, x); }
  point unit() const { return *this / dist(); }
  point perp() const { return point(-y, x); }
  point normal() const { return perp().unit(); }
  point rotate(double a) const {
    return point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
  }
  friend ostream& operator<<(ostream& os, point p) {
    return os << "(" << p.x << "," << p.y << ")";
  }
};
double cross(point a, point b) { return a.x * b.y - a.y * b.x; }
bool onSegment(point s, point e, point p) {
  return p.cross(s, e) == 0 && (s - p).dot(e - p) <= 0;
}
struct polygon {
  vector<point> p;
  polygon() {}
  double area() {
    int n = p.size();
    if (n < 3) return 0;
    double ans = 0;
    for (int i = 1; i < n - 1; i++) ans += cross(p[i] - p[0], p[i + 1] - p[0]);
    return 0.5 * ans;
  }
};
int checkPolyP(polygon& poly, point q) {
  int pd = 0;
  int n = poly.p.size();
  for (int i = 0; i < n; i++) {
    point &u = poly.p[i], v = poly.p[(i + 1) % n];
    if (onSegment(u, v, q)) return 1;
    pd ^= ((q.y < u.y) - (q.y < v.y)) * cross(u - q, v - q) > 0;
  }
  return pd << 1;
}
}  // namespace geometry
using namespace geometry;
double segDist(point& s, point& e, point& p) {
  if ((s - e).dist2() < eps) return (p - s).dist();
  auto d = (e - s).dist2(), t = min(d, max(.0, (p - s).dot(e - s)));
  return ((p - s) * d - (e - s) * t).dist() / d;
}
int main() {
  int n;
  double w, h;
  scanf("%lf %lf %d", &w, &h, &n);
  vector<polygon> p(n);
  vector<double> area(n);
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    p[i].p.resize(v);
    for (auto& j : p[i].p) scanf("%lf%lf", &j.x, &j.y);
    area[i] = p[i].area();
  }
  int q;
  cin >> q;
  while (q--) {
    point o;
    double R;
    scanf("%lf %lf %lf", &o.x, &o.y, &R);
    double ans = 0;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int n = p[i].p.size();
      if (checkPolyP(p[i], o)) goto inside;
      for (int j = 0; j < n; j++) {
        point &l = p[i].p[j], r = p[i].p[(j + 1) % n];
        if (cmp(segDist(l, r, o), R) <= 0) {
          goto inside;
        }
      }
      continue;
    inside:
      v.emplace_back(i);
      ans += area[i];
    }
    cout << ans << ' ' << v.size();
    for (auto i : v) {
      cout << ' ' << i;
    }
    cout << endl;
  }
}
