Humanity's time on Earth is running out. Cooper and Amelia have volunteered for a mission beyond this galaxy to find out whether mankind has a future among the stars. Astronomers have identified several potentially habitable planets and found that some pairs of them are joined by wormholes. Travelling through a wormhole covers a distance of 0. Between any other two planets the travel distance is the Euclidean distance.
Given the planets and the wormholes, find the shortest travel distance between the two planets of each query.
name x y z (0≤x,y,z≤2×106). A name consists only of ASCII letters and digits, always starts with a letter, and is at most 50 characters long. Names are case-sensitive, so Earth and earth are distinct planets. Coordinates are given in parsecs.For each test case, first print Case i: on its own line, where i is the number of the test case, counting from 1.
Then, for each query of that test case, print one line reading The distance from planet1 to planet2 is d parsecs., where planet1 and planet2 are the names as given in the query and d is the shortest travel distance from planet1 to planet2, rounded to the nearest integer. If the value falls exactly halfway between two integers, round up.