The first line of input contains a positive integer N, the number of test cases. The first line of each test case contains T <= 20, the number of train routes. Each train route is described by one or more lines containing:
- S <= 20 The number of stations on the route including origin and terminus.
- hh:mm The starting time of the route (in 24-hour clock notation; that is, in the range 00:00 to 23:59). You may assume that a train leaves the origin every day at this time. A station name is a string of no more than 40 alphabetic characters.
- A list of the names of the S stations, separated by the travel time between adjacent stations. Travel time is given in hours and minutes.
Finally, each test case gives the name of an origin and destination for which a schedule is to be generated. You may assume there is at least one route from the specified origin to the specified destination.