#include <iostream>
#include <cmath>
using namespace std;

const int MAXS = 125;
const int MAXG = 100;
const int MAXA = 100;
const double PI = 4*atan(1.0);
const double TOL = 0.000001;

struct wallseg
{
	char type;
	int x, y;
	double cx, cy;
	double r;
	double ang1, ang2;
	int dx, dy;
} segs[MAXS+1];

struct ga
{
	int x, y;
	int level;
} guards[MAXG], art[MAXA];

void setCircle(wallseg& seg, int x1, int y1, int x2, int y2, int dx, int dy)
{
	double a = x2 -x1;
	double b = y2 - y1;
	double c = (x2*x2-x1*x1+y2*y2-y1*y1)/2.0;		// ax+by=c eqn of line of points equidistant from (x1,y1) and (x2,y2)

	double d = dx;
	double e = dy;
	double f = d*x1+e*y1;							// dx+ey=f eqn of line containing radius and (x1,y1)

	double den = a*e-b*d;
	if (den == 0) {
		cout << "ERROR: undefined circle starting at point " << x1 << ',' << y1 << endl;
		return;
	}
	seg.cx = (c*e - b*f)/den;
	seg.cy = (a*f - c*d)/den;
	seg.r = sqrt((seg.cx-x1)*(seg.cx-x1)+(seg.cy-y1)*(seg.cy-y1));
												// determine range of angles
	seg.ang1 = atan2(y1-seg.cy, x1-seg.cx);			// assume increasing from ang1
	seg.ang2 = atan2(y2-seg.cy, x2-seg.cx);
	double zcross = (x1-seg.cx)*dy - (y1-seg.cy)*dx;
	if (zcross < 0) {								// if z componet of cross product of radius vector with
		double tmp = seg.ang1;						//   tangent vector < 0, the decreasing from ang1
		seg.ang1 = seg.ang2;
		seg.ang2 = tmp;
	}
//	if (seg.ang1 < 0)			// don't think this is necesary
//		seg.ang1 += 2*PI;
//	if (seg.ang2 < 0)
//		seg.ang2 += 2*PI;
}

void inputRoom(int offset, int ns)
{
	for(int i=offset; i<offset+ns; i++) {
		cin >> segs[i].x >> segs[i].y >> segs[i].type;
		if (segs[i].type == 'c')
			cin >> segs[i].dx >> segs[i].dy;
	}
	segs[offset+ns] = segs[offset];
	for(int i=offset; i<offset+ns; i++) {
		if (segs[i].type == 'c') {
			setCircle(segs[i], segs[i].x, segs[i].y, segs[i+1].x, segs[i+1].y, segs[i].dx, segs[i].dy);
//cout << "circle at " << segs[i].x << ',' << segs[i].y << ": center = " << segs[i].cx <<',' << segs[i].cy << " radius = " << segs[i].r << ", arc from " << segs[i].ang1 << " to " << segs[i].ang2 << endl;
		}
		else {
			segs[i].dx = segs[i+1].x-segs[i].x;
			segs[i].dy = segs[i+1].y-segs[i].y;
		}
	}
}

bool between(int a, int b, int c)
{
	if (b < c)
		return (a >= b && a <= c);
	else
		return (a >= c && a <= b);
}

bool arcbetween(double a, double b, double c)
{
	if (b < c)
		return (a >= b && a <= c);
	else
		return (a >= b || a <= c);
}

bool ok(double t, int sx, int sy, double dx, double dy, wallseg seg)
{
	if (t < 0.0 || t > 1.0)			// check if intersection is in line segment
		return false;
	double x = sx + t*dx;
	double y = sy + t*dy;
									// check if intersection is in arc
	double ang = atan2(y - seg.cy, x - seg.cx);
	return arcbetween(ang, seg.ang1, seg.ang2);
}
	
bool lineLineIntersect(double x1, double y1, double x2, double y2, wallseg seg)
{
	double a = x2-x1;			// solve at + bu = c
	double b = -seg.dx;			//		 dt + eu = f
	double c = seg.x - x1;
	double d = y2-y1;
	double e = -seg.dy;
	double f = seg.y - y1;
	double denom = a*e - d*b;
	if (denom == 0) {			// lines are parellel
		return false;				// since in this case walls are connected,
									//  we will detect an intersection on the
									//  next or prev wall, so can just return
									//  false here
	}
	double t = (c*e-f*b)/denom;
	double u = (a*f-d*c)/denom;
	return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0);
}

int lineArcIntersect(double x1, double y1, double x2, double y2, wallseg seg)
{
//cout << "arc check between " << x1 <<',' << y1 << " and " << x2 << ',' << y2 << endl;
	double dx = x2-x1;
	double dy = y2-y1;
	double t1 = x1 - seg.cx;
	double t2 = y1 - seg.cy;
	double a = dx*dx + dy*dy;
	double b = 2*(t1*dx + t2*dy);
	double c = t1*t1+t2*t2-seg.r*seg.r;
	double disc = b*b - 4*a*c;
//cout << "  disc = " << disc << endl;
	if (fabs(disc) <= TOL)
		disc = 0.0;
	if (disc < 0.0)
		return 0;
	t1 = (-b+sqrt(disc))/2/a;
//cout << "  t1 = " << t1 << endl;
	int count = 0;
	if (ok(t1, x1, y1, dx, dy, seg)) {
		if (disc != 0.0)
			count++;
	}
	t2 = (-b-sqrt(disc))/2/a;
//cout << "  t2 = " << t2 << endl;
	if (ok(t2, x1, y1, dx, dy, seg)) {
		if (disc != 0.0)
			count++;
	}
	return count;
}

bool checkInside(int x, int y, int nw)
{
	int count = 0;
	for(int i=0; i<nw; i++) {
		if (segs[i].type == 's' && lineLineIntersect(x, y+0.5, 1000000.0, y+0.5, segs[i]))
			count++;
		else if (segs[i].type == 'c')
			count += lineArcIntersect(x, y+0.5, 1000000.0, y+0.5, segs[i]);
	}
	return (count%2 == 1);
}

int main()
{
	int nr, ns, na, ng;
	int icase=0;
	cin >> nr >> na >> ng;
	while (nr != 0) {
		cout << "Case " << ++icase << endl;
cout << nr;
		if (na < 0 || na > MAXA)
			cout << "ERROR: invalid number of art pieces: " << na << endl;
		if (ng < 0 || ng > MAXG)
			cout << "ERROR: invalid number of guards: " << ng << endl;
		int ns, tots = 0;
		for(int i=0; i<nr; i++) {
			cin >> ns;
			inputRoom(tots, ns);
			tots += ns;
		}
cout << ' ' << tots << endl;
		if (tots < 0 || tots > MAXS)
			cout << "ERROR: invalid number of walls: " << tots << endl;
		for(int i=0; i<na; i++) {
			cin >> art[i].x >> art[i].y >> art[i].level;
			if (!checkInside(art[i].x, art[i].y, tots))
				cout << "ERROR: art piece " << i << " not inside room" << endl;
		}
		for(int i=0; i<ng; i++) {
			cin >> guards[i].x >> guards[i].y >> guards[i].level;
			if (!checkInside(guards[i].x, guards[i].y, tots))
				cout << "ERROR: guard " << i << " not inside room" << endl;
		}
		for(int i=0; i<na; i++) {
			for(int j=0; j<ng; j++) {
				int dx = art[i].x - guards[j].x;
				int dy = art[i].y - guards[j].y;
				if (dx == 0 && dy == 0) {
					cout << "ERROR: repeated point: art  " << i << " and guard " << j << endl;
				}
				int c = dy*art[i].x - dx*art[i].y;
				for(int k=0; k<tots; k++) {
					if (segs[k].x*dy - segs[k].y*dx == c && between(segs[k].x, art[i].x, guards[i].x) && between(segs[k].y, art[i].y, guards[i].y)) {
						cout << "ERROR: colinear points: art " << i  << '(' << art[i].x << ',' << art[i].y << "), guard " << j << '(' << guards[j].x << ',' << guards[j].y << ") and wall seg " << k << endl;
					}
				}
			}
		}

		cin >> nr >> na >> ng;
	}
}
