Bob and Hannah like darts but are not good at it, so finishing a round of 501 takes them forever. They put the dartboard away, taped geometric shapes to the wall instead, and now score a dart by how many shapes it goes through. To keep the scoring simple they use only circles, triangles and rectangles.
In one game each player throws three darts. A dart scores the number of shapes that contain the point it landed on, and a player's score is the sum over their three darts. Given the shapes and the throws, report the winner of each game.
The first line has the number of shapes S. Each of the next S lines describes one shape in one of these three formats:
C x y r: a circle with center (x,y) and radius rR x1 y1 x2 y2: a rectangle whose opposite corners are (x1,y1) and (x2,y2), with x1<x2 and y1<y2T x1 y1 x2 y2 x3 y3: a triangle with corners (x1,y1), (x2,y2) and (x3,y3)The next line has the number of games N. Each game takes six lines, and each line has the x and y coordinate of one landing point. The first three lines are Bob's throws and the last three are Hannah's.
Print the winner of each game on its own line. Print Bob if Bob scores higher, Hannah if Hannah scores higher, and Tied if the two scores are equal.