Hide

Problem B
Pachyderm Peanut Packing

You are an elephant working for peanuts. The job that you do is to walk around the packing plant and make sure that peanuts are being packed correctly. Peanuts at your plant are packed by size — small, medium, and large. You walk around and note every peanut that is packed in the wrong type of box, or that is not packed in any box, so that your boss (the principal peanut packing pachyderm) can know of any problems.

Input

Input contains a sequence of up to $100$ test cases. Each case starts with an integer $1 \le n \le 30$, followed by $n$ box descriptions, one per line. A box is described by the real-valued coordinates for two of its corners $x_1~ y_1~ x_2~ y_2$, where $x_1 < x_2$ and $y_1 < y_2$, and the type of peanuts it should hold (small, medium, or large). There are no two boxes that overlap or touch. After the list of box descriptions is an integer $0 \le m \le 100$, followed by $m$ peanut descriptions, one per line. Each peanut is described by a pair of real-valued coordinates $x~ y$ indicating its location, and the type of peanut that it is (small, medium, or large). All real-valued inputs are in the range $[0, 300]$ and have at most $8$ digits past the decimal point. Input ends when $n = 0$.

Output

For each test case, print the size and status of each of the peanuts inspected, in the order they are given. If a peanut is in a box of the correct size, its status is ‘correct’. If it is on the floor, its status is ‘floor’. Otherwise, its status is the size of the box that it is in. A peanut just on the edge of a box is considered to be inside that box. Print a blank line between each pair of test cases.

Sample Input 1 Sample Output 1
2
0 0 1 1 small
3 2 6 5 large
3
2 0 small
0.5 0.6 medium
3 4 large
3
60.0 2.9 111.4 32.9 medium
20.0 82.6 43.4 153.1 small
34.7 9.6 56.6 78.2 large
6
60.0 8.3 small
43.4 153.1 small
13.4 55.9 medium
61.5 68.1 medium
72.1 69.1 large
78.4 13.2 large
0
small floor
medium small
large correct

small medium
small correct
medium floor
medium floor
large floor
large medium

Please log in to submit a solution to this problem

Log in