Airlines -------- A leading airlines company has hired you to write a program that answers the following query: given a list of city locations (latitudes and longitudes) and a list of direct flights what is the minimum distance a passenger needs to fly to get from a given city to another? To get from a city to another a passenger may either take a direct flight (if exists) or take a sequence of connecting flights (if there exists such a route). Assume that if a passenger takes a direct flight from X to Y he never flies more than the geographical distance between X and Y. The geographical distance between two locations X and Y is the length of the geodetic line segment connecting X and Y. The geodetic line segment between two points on a sphere is the shortest connecting curve lying entirely in the surface of the sphere. Assume that the Earth is a perfect sphere with a radius of exactly 6378-km and the value of p is approximately 3.141592653589793. Round the geographical distance between every pair of cities to the nearest integer. Input ----- The input may contain multiple test cases. The first line of each test case contains three integers N (N <= 100), M (M <= 300) and Q (Q <= 10000) where N indicates the number of cities, M represents the number of direct flights and Q is the number of queries. The next N lines contain the city list. The i-th of these N lines will contain a string ci followed by two real numbers lti and lni, representing the city name, its latitude and longitude respectively. The city name will be no longer than 50 characters and will not contain white-space characters. The latitude will be between -90 (South Pole) and +90 (North Pole). The longitude will be between -180 and +180 where negative numbers denote locations west of the meridian and positive numbers denote locations east of the meridian. (The meridian passes through Greenwich, London.) The next M lines contain the direct flight list. The i-th of these M lines will contain two city names ai and bi indicating that there exists a direct flight from city ai to city bi. Be assured that both city names will occur in the city list. The next Q lines contain the query list. The i-th of these Q lines will contain two city names ai and bi asking for the minimum distance a passenger needs to fly in order to get from city ai to city bi. Be assured that ai and bi are not equal and both city names will occur in the city list. The input will terminate with three zeros form N, M and Q. Output ------ For each test case in the input first output the test case number (starting from 1) as shown in the sample output. Then for each query in the input print a line giving the shortest distance (in km) a passenger needs to fly to get from the first city (ai) in the query to the second one (bi). If there exists no route form ai to bi, just print the line "no route exists". Print a blank line between two consecutive test cases. Sample Input ------------ 2 1 1 Amsterdam 52.22 4.53 Toronto 43.41 79.38 Toronto Amsterdam Toronto Amsterdam 2 1 1 Amsterdam 52.22 4.53 Toronto 43.41 79.38 Toronto Amsterdam Amsterdam Toronto 3 2 1 Toronto 43.41 79.38 Teheran 35.45 51.45 Milan 45.27 9.10 Toronto Milan Milan Teheran Toronto Teheran 3 2 1 Amsterdam 52.22 4.53 Toronto 43.41 79.38 Teheran 35.45 51.45 Toronto Amsterdam Amsterdam Teheran Toronto Teheran 4 4 1 Amsterdam 52.22 4.53 Toronto 43.41 79.38 Teheran 35.45 51.45 Milan 45.27 9.10 Toronto Amsterdam Amsterdam Teheran Toronto Milan Milan Teheran Toronto Teheran 0 0 0 Sample Output ------------- Case #1 5426 km Case #2 no route exists Case #3 9123 km Case #4 9538 km Case #5 9123 km