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.