Vampires!

Time limit1sMemory limit128 MB

Problem

A room contains some vampires, some ordinary mortals, and some mirrors, all placed on a grid. Each mirror faces one of four directions — north (N), south (S), east (E), or west (W) — and this orientation tells you which side of the mirror is the reflecting side.

A vampire casts no reflection, and being unable to appear in a mirror is embarrassing. A vampire is in danger of this embarrassment if it lies on a straight horizontal or vertical line with the reflecting side of a mirror and nothing stands in between. Only mortals and other mirrors block the line of sight; a vampire never blocks it, because a vampire casts no reflection and so cannot shield another vampire.

Your job is to tell each vampire the directions in which it is in danger.

Input

Each test case begins with three integers $v$, $o$, $m$: the number of vampires, ordinary mortals, and mirrors in the room.

The next $v$ lines each contain a pair of integers $x$, $y$ ($0 \le x, y \le 100$) giving the grid square of a vampire, where $x = 0$ is the westernmost column and $y = 0$ is the southernmost row.

The next $o$ lines give the grid squares of the ordinary mortals in the same format.

The next $m$ lines each describe a mirror: a letter (N, S, E, or W) giving the reflecting orientation, followed by four integers $x_1\ y_1\ x_2\ y_2$ giving the start and end squares of the mirror (same coordinate bounds). A mirror may have any positive length, is one grid square thick, and always lies along the east-west or north-south axis.

Each grid square holds at most one vampire, mortal, or mirror section. The last test case is followed by a line containing 0 0 0.

Output

For each test case, print the case number on its own line. Then, for every vampire that is in danger of embarrassment, print one line containing the word vampire, the vampire's number (vampires are numbered from 1 to $v$ in the order they appear in the input), and the directions it must avoid.

The direction to avoid points from the vampire toward the reflecting mirror, which is the opposite of the mirror's orientation. For instance, if a vampire is exposed to a south-facing mirror and an east-facing mirror, the directions to avoid are north and west. List the directions in alphabetical order (for example, north west, not west north).

If no vampire in a test case is in danger, print the word none instead. Print the endangered vampires in increasing order of their numbers.