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 ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template <typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) { return (ull)rng() % B; }
clock_t startTime;
double getCurrentTime() {
  return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
const double eps = 1e-7;
bool eq(double x, double y) { return abs(x - y) < eps; }
bool ls(double x, double y) { return x < y && !eq(x, y); }
bool lseq(double x, double y) { return x < y || eq(x, y); }
double sqr(double x) { return x * x; }
struct Point {
  double x, y;
  Point() : x(), y() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
  void scan() { scanf("%lf%lf", &x, &y); }
  void print() { printf("%.12lf %.12lf\n", x, y); }
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator*(const double &k) const { return Point(x * k, y * k); }
  Point operator/(const double &k) const { return Point(x / k, y / k); }
  double operator%(const Point &a) const { return x * a.x + y * a.y; }
  double operator*(const Point &a) const { return x * a.y - y * a.x; }
  double sqrLen() const { return *this % *this; }
  double len() const { return sqrt(sqrLen()); }
  Point norm() const { return *this / len(); }
  Point ort() const { return Point(-y, x); }
};
double getAngle(Point v, Point u) { return atan2(v * u, v % u); }
bool onLine(Point A, Point B, Point C) { return eq((A - B) * (A - C), 0); }
bool onSegm(Point A, Point B, Point C) {
  if (!onLine(A, B, C)) return false;
  return lseq((A - B) % (C - B), 0);
}
bool intersectLines(Point A, Point a, Point B, Point b, Point &I) {
  if (eq(a * b, 0)) return false;
  double y = ((A - B) * a) / (b * a);
  I = B + b * y;
  return true;
}
Point getH(Point P, Point A, Point a) {
  return A + a * (((P - A) % a) / a.sqrLen());
}
bool intersectLineCircle(Point A, Point a, Point O, double R, Point &I1,
                         Point &I2) {
  Point H = getH(O, A, a);
  double x = (O - H).len();
  if (ls(R, x)) return false;
  if (eq(R, x)) {
    I1 = I2 = H;
    return true;
  }
  a = a.norm();
  x = sqrt(sqr(R) - sqr(x));
  I1 = H + a * x;
  I2 = H - a * x;
  return true;
}
bool intersectCircles(Point O1, double R1, Point O2, double R2, Point &I1,
                      Point &I2) {
  if (R1 < R2) {
    swap(O1, O2);
    swap(R1, R2);
  }
  double L = (O1 - O2).len();
  if (ls(R1 + R2, L) || ls(L, R1 - R2) || eq(L, 0)) return false;
  if (eq(R1 + R2, L) || eq(L, R1 - R2)) {
    I1 = I2 = O1 + (O2 - O1).norm() * R1;
    return true;
  }
  double x = (sqr(R1) - sqr(R2) + sqr(L)) / (2 * L);
  Point a = (O2 - O1).norm();
  Point H = O1 + a * x;
  a = a.ort();
  x = sqrt(sqr(R1) - sqr(x));
  I1 = H + a * x;
  I2 = H - a * x;
  return true;
}
bool isInside(Point P, Point O, double R) {
  return lseq((P - O).sqrLen(), sqr(R));
}
vector<vector<Point>> a;
vector<double> sz;
bool insidePoly(Point P, vector<Point> w) {
  int m = (int)w.size() - 1;
  for (int i = 0; i < m; i++)
    if (onSegm(w[i], P, w[i + 1])) return true;
  double ang = 0;
  for (int i = 0; i < m; i++) ang += getAngle(w[i] - P, w[i + 1] - P);
  return abs(ang) > 1;
}
bool checkPoly(vector<Point> w, Point O, double R) {
  if (insidePoly(O, w)) return true;
  int m = (int)w.size() - 1;
  for (int i = 0; i < m; i++) {
    if (isInside(w[i], O, R)) return true;
    Point H = getH(O, w[i], w[i + 1] - w[i]);
    if (isInside(H, O, R) && onSegm(w[i], H, w[i + 1])) return true;
  }
  return false;
}
vector<Point> readPoly() {
  int n;
  scanf("%d", &n);
  vector<Point> a(n + 1);
  for (int i = 0; i < n; i++) a[i].scan();
  a[n] = a[0];
  return a;
}
double sizePoly(vector<Point> w) {
  double S = 0;
  int m = (int)w.size() - 1;
  for (int i = 0; i < m; i++) S += w[i] * w[i + 1];
  return abs(S) / 2;
}
int main() {
  startTime = clock();
  double R;
  int n, w;
  scanf("%lf%lf%d", &R, &R, &n);
  a.resize(n);
  sz.resize(n);
  for (int i = 0; i < n; i++) {
    a[i] = readPoly();
    sz[i] = sizePoly(a[i]);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    Point O;
    O.scan();
    scanf("%lf", &R);
    vector<int> res;
    double S = 0;
    for (int i = 0; i < n; i++) {
      if (checkPoly(a[i], O, R)) {
        res.push_back(i);
        S += sz[i];
      }
    }
    printf("%.12lf %d", S, (int)res.size());
    for (int x : res) printf(" %d", x);
    printf("\n");
  }
  return 0;
}