Horseshoe Scoring

No attempts yetTime limit1sMemory limit128 MB

Problem

The game of horseshoes is played by tossing horseshoes at a post driven into the ground. A turn is made up of four tosses, and the score of a toss depends on where the horseshoe lands relative to the post.

Each horseshoe is a semicircular arc of radius 10 cm. Its position is given by two points: the center A of the semicircle, and the point B that bisects the arc (so B lies on the arc and $|AB| = 10$). The arc bulges toward B, and its two legs are the endpoints of the arc — the points where the line through A perpendicular to $AB$ meets the arc.

The post stands at the origin $(0, 0)$ and is 2 cm in diameter, so it occupies the disk of radius 1 cm centered at the origin. The top of the post is level with the ground, so a horseshoe may lie across it.

A single toss is scored as follows:

  • Ringer — 5 points. The center of the post lies inside the region bounded by the arc and the imaginary segment joining the two legs (that is, the origin is within 10 cm of A and on the B side of the leg line), and the horseshoe does not touch the post.
  • Toucher — 2 points. Some part of the arc lies within 1 cm of the origin (the horseshoe touches the post).
  • Swinger — 1 point. The toss is neither a ringer nor a toucher, yet pivoting the horseshoe would bring its arc onto the post: the center of the post lies between 9 cm and 11 cm from A, so the radius-10 arc can be rotated to reach the post.
  • Zero points. Any horseshoe matching none of the above.

The score of a turn is the sum of the point values of its four tosses.

Input

The input is a sequence of turns; each turn is four consecutive lines, one per toss. Every line holds two coordinate pairs — four real numbers with up to three digits after the decimal point, with $-100.0 \le X, Y \le 100.0$. The first pair is the center A $(x, y)$ of the horseshoe, and the second pair is the bisecting point B $(x, y)$.

Lines 1–4 form the first turn, lines 5–8 the second, and so on. There are at most 999 turns, and every turn has exactly four tosses. The semicircle always has radius 10 cm, and B gives the direction from A toward the middle of the arc (if $|AB|$ is not exactly 10, use only its direction). Read until the end of input.

Output

Print Turn Score on the first line. Then, for each turn, print one line: the turn number (numbered from 1) left-aligned in a field of width 3, followed by two spaces, followed by the turn's total score left-aligned in a field of width 2.