SP30 BLINNET - Bytelandian Blingors Network

Description

_We have discovered the fastest communication medium_ Bytelandian scientists announced, and they called it _blingors_. The blingors are incomparably better than other media known before. Many companies in Byteland started to build blingors networks, so the information society in the kingdom of Bytes is fact! The priority is to build the core of the blingors network, joinig main cities in the country. Assume there is some number of cities that will be connected at the beginning. The cost of building blingors connection between two cities depends on many elements, but it has been successfully estimated. Your task is to design the blingors network connections between some cities in this way that between any pair of cities is a communication route. The cost of this network should be as small as possible. Remarks - The name of the city is a string of at most 10 letters from _a,...,z_. - The cost of the connection between two cities is a positive integer. - The sum of all connections is not greater than 2 $ ^{32} $ -1. - The number of cities is not greater than 10 000.

Input Format

N/A

Output Format

N/A

Explanation/Hint

**Warning: large Input/Output data, be careful with certain languages**