Problem: After making a strategic plan with carriers for expansion of mobile network throughout the whole country, the government decided to cover rural areas with the last generation of 5G network.

Since 5G antenna towers will be built in the area of mainly private properties, the government needs an easy way to find information about landowners for each property partially or fully contained in the planned building area. 

The planned building area is represented as a rectangle with sides width and height.

Every 5G antenna tower occupies a circle with a center in (x,y) and radius r. 

There is a database of Geodetic Institute containing information about each property. Each property is defined with its identification number and polygon represented as an array of (x,y) points in the counter-clockwise direction. 

Your task is to build an IT system which can handle queries of type (x, y, r) in which (x,y) represents a circle center, while r represents its radius. The IT system should return the total area of properties that need to be acquired for the building of a tower so that the government can estimate the price. Furthermore, the system should return a list of identification numbers of these properties (so that the owners can be contacted for land acquisition).

A property needs to be acquired if the circle of the antenna tower is intersecting or touching it. 

Input

The first line contains the size of the building area as double values width, height, and an integer n — the number of properties in the database. 

Each of the next n lines contains the description of a single property in the form of an integer number v (3 ≤ v ≤ 40) — the number of points that define a property, as well as 2*v double numbers — the coordinates (x,y) of each property point. Line i (0 ≤ i ≤ n-1) contains the information for property with id i.

The next line contains an integer q — the number of queries. 

Each of the next q lines contains double values x, y, r — the coordinates of an antenna circle center (x, y) and its radius r.

1 ≤ n * q ≤ 10^6

Output

For each of the q queries, your program should output a line containing the total area of all the properties that need to be acquired, an integer representing the number of such properties, as well as the list of ids of these properties (separated by blank characters, arbitrary order).

Example

Input


10 10 3
4 2 2 3 2 3 3 2 3
3 3.5 2 4.5 2 4.5 3
4 7 8 7.5 8.5 8 8 7.5 9
5
2 3.5 0.5
3.3 2 0.4
5 2.5 0.5
7.5 8.5 0.5
3 7 0.5


Output


1.000000 1 0 
1.500000 2 0 1 
0.500000 1 1 
0.250000 1 2 
0.000000 0 

Note

You can assume that the land not covered with properties (polygons) is under the government's ownership and therefore doesn't need to be acquired. Properties do not intersect with each other.

Precision being used for solution checking is 10^{-4}.

Solution (in CPP):

Solution:
#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;
}