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;
double rd_() {
  string s;
  cin >> s;
  int k = s.size();
  int p = find(begin(s), end(s), '.') - begin(s);
  if (p == k) {
    long long x = 0;
    for (int i = 0; i < k; i++) {
      x = 10 * x + s[i] - 48;
    }
    return x;
  } else {
    long long x = 0, f = 0, g = 1;
    for (int i = 0; i < p; i++) {
      x = 10 * x + s[i] - 48;
    }
    for (int i = p + 1; i < k; i++) {
      f = 10 * f + s[i] - 48;
      g = 10 * g;
    }
    return double(x * g + f) / g;
  }
}
double rd() {
  double x;
  scanf("%lf", &x);
  return x;
}
struct pt {
  double x, y;
};
struct hcirc {
  double x, y, r;
};
int n;
vector<pt> a[1000005];
double povrs[1000005];
hcirc hc[1000005];
inline double sq(double x) { return x * x; }
int main() {
  ios::sync_with_stdio(!cin.tie(0));
  rd();
  rd();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int c;
    scanf("%d", &c);
    a[i].resize(c);
    for (auto& [x, y] : a[i]) {
      x = rd();
      y = rd();
    }
    double xlo = 1e18, xhi = -1e18;
    double ylo = 1e18, yhi = -1e18;
    for (int j = 0; j < c; j++) {
      int k = j == c - 1 ? 0 : j + 1;
      auto [u, v] = a[i][j];
      auto [p, q] = a[i][k];
      povrs[i] += u * q - p * v;
      xlo = min(xlo, u);
      ylo = min(ylo, v);
      xhi = max(xhi, u);
      yhi = max(yhi, v);
    }
    hc[i] = {(xlo + xhi) / 2, (ylo + yhi) / 2,
             sqrt(sq(xhi - xlo) + sq(yhi - ylo)) / 2};
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    double x, y, r;
    x = rd();
    y = rd();
    r = rd();
    double mv = r * 0.1273123;
    basic_string<int> sol;
    double s = 0;
    for (int i = 0; i < n; i++) {
      int c = a[i].size();
      bool touch = false;
      int h = 0;
      if (sq(hc[i].x - x) + sq(hc[i].y - y) > sq(r + hc[i].r)) {
        continue;
      }
      for (int j = 0; j < c; j++) {
        int k = j == c - 1 ? 0 : j + 1;
        auto [p, q] = a[i][j];
        auto [u, v] = a[i][k];
        p -= x;
        q -= y;
        u -= x;
        v -= y;
        double sqd = sq(p - u) + sq(q - v);
        double det = q * u - p * v;
        double mul = det / sqd;
        double hx = (q - v) * mul;
        double hy = (u - p) * mul;
        double r2 = sq(r);
        if ((hx - p) * (hx - u) + (hy - q) * (hy - v) < 0) {
          touch |= sq(hx) + sq(hy) <= r2;
        }
        touch |= sq(p) + sq(q) <= r2;
        if (touch) break;
        p += mv;
        u += mv;
        if (p * u < 0 && (p - u) * (q * u - p * v) < 0) h++;
      }
      if (touch || h % 2) {
        sol += i;
        s += povrs[i];
      }
    }
    printf("%lf %d\n", s / 2, (int)sol.size());
    for (int x : sol) printf(" %d", x);
    printf("\n");
  }
}