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>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops", \
                     "omit-frame-pointer", "inline")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,fma,tune=native")
#pragma GCC option("arch=native", "no-zero-upper")
using namespace std;
const long long oo = (long long)(1e11);
int szs[(long long)(1e6 + 5)];
vector<complex<double> > ps[(long long)(1e6 + 5)];
vector<double> ds[(long long)(1e6 + 5)];
double as[(long long)(1e6 + 5)];
char cs[(long long)(1e6 + 5)];
double read0() {
  scanf("%s", cs);
  double res = 0;
  int p = 0;
  bool past_dot = 0;
  double p10 = 0.1;
  while (cs[p] != '\0') {
    if (cs[p] == '.') {
      past_dot = 1;
      p++;
      continue;
    }
    double vp = cs[p] - '0';
    if (past_dot) {
      res += vp * p10;
      p10 /= 10.0;
    } else {
      res *= 10;
      res += vp;
    }
    p++;
  }
  return res;
}
complex<double> read() {
  double x = read0();
  double y = read0();
  return complex<double>(x, y);
}
struct line {
  complex<double> p, q;
};
using segment = line;
double dot(complex<double> a, complex<double> b) { return real(conj(a) * b); }
double cross(complex<double> a, complex<double> b) { return imag(conj(a) * b); }
int ccw(complex<double> a, complex<double> b, complex<double> c) {
  b -= a;
  c -= a;
  if (cross(b, c) > 0) return +1;
  if (cross(b, c) < 0) return -1;
  if (dot(b, c) < 0) return +2;
  if (dot(b, b) < dot(c, c)) return -2;
  return 0;
}
bool intersectSS(const segment &second, const segment &t) {
  return ccw(second.p, second.q, t.p) * ccw(second.p, second.q, t.q) <= 0 &&
         ccw(t.p, t.q, second.p) * ccw(t.p, t.q, second.q) <= 0;
}
double area2(const vector<complex<double> > &P) {
  double A = 0;
  for (int i = 0, n = P.size(); i < n; ++i)
    A += cross(P[i], P[(((i) + 1) % n)]);
  return fabs(A / 2);
}
double min_dis(double ab, double ac, double bc) {
  double cos_abc = (ac * ac - ab * ab - bc * bc) / (-2.0 * ab * bc);
  double cos_acb = (ab * ab - ac * ac - bc * bc) / (-2.0 * ac * bc);
  if (min(cos_abc, cos_acb) <= (1e-9)) return min(ab, ac);
  return sqrt(1 - cos_abc * cos_abc) * ab;
}
double give_me_random_ang() {
  double ang =
      (((long long)rand() * (1ll << 15)) + (long long)rand()) % (1 << 20);
  ang /= (double)(1 << 20);
  ang *= 2 * acos(-1);
  return ang;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(6);
  cout << fixed;
  srand(time(0));
  double w, h;
  int n;
  scanf("%lf%lf%d", &w, &h, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &szs[i]);
    for (int j = 0; j < szs[i]; j++) {
      complex<double> p = read();
      ps[i].push_back(p);
    }
    for (int j = 0; j < szs[i]; j++)
      ds[i].push_back(abs(ps[i][j] - ps[i][(j + 1) % szs[i]]));
    as[i] = area2(ps[i]);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    double r;
    complex<double> c = read();
    scanf("%lf", &r);
    double a = 0;
    vector<int> indexes;
    for (int i = 0; i < n; i++) {
      vector<double> ds2(szs[i]);
      bool ok = 0;
      int c1 = 0;
      int c2 = 0;
      double a2 = give_me_random_ang();
      segment l2 = {c, c + complex<double>(oo * cos(a2), oo * sin(a2))};
      for (int j = 0; j < szs[i]; j++) {
        ds2[j] = abs(c - ps[i][j]);
        c2 += intersectSS(l2, {ps[i][j], ps[i][(j + 1) % szs[i]]});
      }
      ok = (ok | ((c1 & 1) || (c2 & 1)));
      for (int j = 0; j < szs[i] && !ok; j++)
        ok = (ok |
              (min_dis(ds2[j], ds2[(j + 1) % szs[i]], ds[i][j])) <= r + (1e-9));
      if (ok) {
        a += as[i];
        indexes.push_back(i);
      }
    }
    cout << a << ' ' << indexes.size();
    for (auto y : indexes) cout << ' ' << y;
    cout << '\n';
  }
  return 0;
}