Server#10456

Server

1 second
128 megabytes
Easy

Amin and Murad decided to create a Minecraft game server.

They invited guests to the grand opening of the server. The guests live in different cities, and when connecting to the server, they will experience a certain latency (ping) depending on their location. Realizing the potential issues, Amin and Murad decided to choose the most optimal location for hosting the server.

There are cities, numbered from to , and bidirectional communication channels between them. A connection to the server is only possible through these channels. Using them, it is possible to establish a connection between any two cities. Each pair of cities may have at most one direct communication channel, and no city is connected to itself. Each channel has a transmission delay of w_i.

The connection delay between a city and the server is defined as the minimum possible sum of delays along the path from that city to the server.

Amin and Murad want to choose a city to host the server so that the total connection delay for all guests is minimized. If the server is hosted in the same city where a guest lives, the delay for that guest is considered to be zero.

If there are multiple cities with the same minimum total delay, Amin and Murad will choose the city with the smallest number.

Determine the city where the server will be hosted and the total connection delay for all guests to the server.

Input

The first line contains three integers n~(1 \le n \le 10^4), m~(1 \le m \le 4 * 10^4), k~(1 \le k \le 100) — the number of cities, the number of communication channels, and the number of guests, respectively. The second line contains distinct integers c_i~(1 \le c_i \le n) — the numbers of the cities where the guests live.

Each of the following lines contains three integers u_i, v_i, and w_i~(1 \le u_i, v_i \le n) — describing a bidirectional communication channel between cities u_i and v_i with a delay of w_i~(1 \le w_i \le 10^4).

Output

Print two integers — the number of the city where the server will be hosted, and the total connection delay for all guests to this server.

Examples

Example 1

Loading
Loading