Hoo's Afraid of the Big Bad Wolf?

No attempts yetTime limit1sMemory limit128 MB

Problem

Little Red Riding Hood is walking to her grandmother's house. She reads the Big Bad Wolf's blog, which lists the paths that he and his friends guard. The wolf keeps the details to himself, so the blog only publishes the probability that a path has no wolf on it. If Little Red Riding Hood takes a path a wolf is guarding, she is eaten. Every path through the forest runs in one direction, so she cannot walk back along a path she has taken.

Find the largest probability that Little Red Riding Hood reaches her grandmother's house.

The picture below shows the first example.

Input

The first line contains the number of test cases.

Each test case begins with a line containing an integer NN (1N1001 \le N \le 100), the number of intersections. The next line contains two integers XX and YY (1X,YN1 \le X, Y \le N) separated by a single space, the starting intersection XX and the ending intersection YY. A route from XX to YY always exists. The next line contains an integer MM (0M50000 \le M \le 5000), the number of one directional paths. Each of the next MM lines contains three values separated by spaces: the start intersection AA, the end intersection BB, and the probability PP (0.000<P1.0000.000 < P \le 1.000) that the path from AA to BB is safe, meaning no wolf guards it. Two intersections can be joined by more than one path. Every probability is written with at most three digits after the decimal point.

Output

For each test case print one line in the form Case x: p, where xx is the case number starting from 1 and pp is the probability that Little Red Riding Hood reaches her grandmother's house along the safest route.

Round pp to exactly six digits after the decimal point and keep the trailing zeros. Do not use exponential notation. In every test the answer is farther than 10910^{-9} from a rounding boundary, so the rounded value is unambiguous.

If XX and YY are the same intersection, Little Red Riding Hood is already at the house, so the answer is 11.