Lisa had just learned how to use ruler and compasses, she was so excited and she paint many strange graph. Just like this picture.
In these graph, some side are straight line and others are arc with known center. Now she want to know the area of the graph. Can you help this cute Lolita?
There is a T at the beginning of file, show that there is T case follow.
For each case, first line is an integer n, means there is n dot in the graph.(The number of dot is from 1 to n)
Next n line, each line contain an integer k.
If k=1, then it followed by 2 integer a,b, means dot i is at point(a,b),and dot i link dot (i+1) with a straight line.
Else if k=0 ,then it followed by 4 integer a,b,c,d, means dot i is at point(a,b), and dot i link dot (i+1) with an arc, and the center of the circle is at (c,d).
PS1: For the dot n ,the dot (n+1) means the dot 1.
PS2: All the arc is less than 180。
PS3: 3<=n<=15, 0<=a,b,c,d<=1000
PS4: There is no coincide point and no intersection of any to edge.
For every case, first output"Case #x: ",x mean the number of case.
Then output one number, means the answer,round to 0 digit.
See sample for detail.
1 3 1 1 0 1 0 0 0 0 1 0 0
Case #1: 1