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")
#pragma GCC target("sse4,sse4.2,popcnt,abm,mmx,avx")
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T maxs(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T mins(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
const double eps = 1e-6;
int sgn(const double &first) { return first < -eps ? -1 : first > eps; }
pair<double, double> operator-(const pair<double, double> &a,
                               const pair<double, double> &b) {
  return {a.first - b.first, a.second - b.second};
}
pair<double, double> operator*(const pair<double, double> &a, double b) {
  return {a.first * b, a.second * b};
}
double operator*(const pair<double, double> &a, const pair<double, double> &b) {
  return a.first * b.second - b.first * a.second;
}
double operator%(const pair<double, double> &a, const pair<double, double> &b) {
  return a.first * b.first + a.second * b.second;
}
double dis(const pair<double, double> &a) {
  return sqrt(a.first * a.first + a.second * a.second);
}
bool point_in_polygon(vector<pair<double, double> > &p,
                      pair<double, double> O) {
  int ret = 0;
  int n = p.size();
  for (int i = 0; i < n; i++) {
    pair<double, double> u = p[i], v = p[(i + 1) % n];
    if (sgn(u.second - v.second) <= 0) swap(u, v);
    if (sgn(O.second - u.second) > 0 || sgn(O.second - v.second) <= 0) continue;
    ret += sgn((v - O) * (u - O)) > 0;
  }
  return ret & 1;
}
double Area(const vector<pair<double, double> > &fig) {
  double res = 0;
  for (unsigned i = 0; i < fig.size(); i++) {
    pair<double, double> p = i ? fig[i - 1] : fig.back();
    pair<double, double> q = fig[i];
    res += (p.first - q.first) * (p.second + q.second);
  }
  return fabs(res) / 2;
}
double dist(pair<double, double> A, pair<double, double> B,
            pair<double, double> E) {
  pair<double, double> AB = B - A;
  pair<double, double> BE = E - B;
  pair<double, double> AE = E - A;
  double AB_BE, AB_AE;
  AB_BE = AB % BE;
  AB_AE = AB % AE;
  double reqAns = 0;
  if (AB_BE > 0) {
    return dis(E - B);
  } else if (AB_AE < 0) {
    return dis(E - A);
  } else {
    return abs(AB * AE) / (dis(AB));
  }
}
bool check(pair<double, double> cen, double r,
           vector<pair<double, double> > &p) {
  double dis = 1e15;
  int m = (int)p.size();
  for (int i = 0; i < m; i++) {
    mins(dis, dist(p[i], p[(i + 1) % m], cen));
    if (dis <= r || abs(dis - r) < eps) return 1;
  }
  return 0;
}
const int N = 1e6 + 5;
vector<pair<double, double> > poly[N];
double area[N];
double rd() {
  string s;
  cin >> s;
  int k = s.size();
  int p = find(begin(s), end(s), '.') - begin(s);
  if (p == k) {
    long long first = 0;
    for (int i = 0; i < k; i++) {
      first = 10 * first + s[i] - 48;
    }
    return first;
  } else {
    long long first = 0, f = 0, g = 1;
    for (int i = 0; i < p; i++) {
      first = 10 * first + s[i] - 48;
    }
    for (int i = p + 1; i < k; i++) {
      f = 10 * f + s[i] - 48;
      g = 10 * g;
    }
    return double(first * g + f) / g;
  }
}
int solve() {
  double w, h;
  cin >> w >> h;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    vector<pair<double, double> > vec(v);
    for (int j = 0; j < v; j++) {
      vec[j].first = rd();
      vec[j].second = rd();
    }
    area[i] = Area(vec);
    poly[i] = vec;
  }
  int q;
  cin >> q;
  for (int k = 0; k < q; k++) {
    double first, second, r;
    first = rd(), second = rd(), r = rd();
    pair<double, double> cen = {first, second};
    vector<int> temp;
    double ans = 0;
    for (int i = 0; i < n; i++) {
      if (point_in_polygon(poly[i], cen)) {
        ans += area[i];
        temp.push_back(i);
      } else {
        if (check(cen, r, poly[i])) {
          ans += area[i];
          temp.push_back(i);
        }
      }
    }
    cout << ans << " " << (int)temp.size() << " ";
    for (auto i : temp) cout << i << " ";
    cout << "\n";
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}