Server
Amin and Murad decided to create a "Minecraft" game server. They invited guests to their grand opening ceremony. The invited guests live in different cities and will have a certain ping delay when connecting to the server (depending on the location). Amin and Murad, realizing the potential problem, decided to choose the most optimal location for the server.
There are cities numbered from to and two-way transmission channels between these cities. You can connect to the server only through these channels. Through these channels, you can create a connection between any two cities. However, no two cities can have more than one canal directly connecting them, and no city has canals connecting a city to itself. A delay time of is also given for each channel. And so, the delay time for a connection from a city to a server is equal to the smallest sum of channel delays on the way from this city to a server among all possible paths.
Amin and Murad want to choose a city for the server so that the total connection delay of all guests is minimal during the connection. If the server is located in the city where some of the guests live, then the connection delay for this guest will be equal to .
If it is possible to select several cities with a minimum total delay, then Amin and Murad will choose the city with the lowest number. You need to find the city that Amin and Murad will choose and the total delay in connecting all guests to the server.
Input
The first line contains three integers — the number of cities, transmission channels and guests, respectively. The second line contains different numbers — the numbers of the cities where the guests live. Each of the following lines contains three integers . These numbers indicate a two-way link between the cities and with a delayed connection .
Output
Print two integers — the number of the city where the server will be located and the total delay in connecting all guests to this server.