PROGRAMMING:Escort agency
The escort of an escort agency is to transport goods (similar to current logistics). Every time the escort agency goes to a new place to carry out business, it needs to take care of the heroes on the way. The management fee is lower for those who are easy to talk, and higher for those who are not easy to talk. Longmen escort agency now has an escort. Please plan your route. Given the map of the city, you need to choose some roads to clear it so that the escort agency can reach any city. The less money you need, the better.
###Input format:
The first line has two numbers N and M. n means there are n cities (numbered from 1 to n), and M means there are m roads. Next, m lines, each line shaped like "a, B, C" is used to represent a road, which means that city a is connected to city B, and the amount of money needed for management is C.
###Output format:
If you can reach all the cities through management, you can output the total amount of silver you need to spend at least. If you can't reach all the cities, output "impossible".
###Input example:
```in
3 3
1 2 1
1 3 2
2 3 4
```
###Output example:
```out
three
```
answer:If there is no answer, please comment
###Input format:
The first line has two numbers N and M. n means there are n cities (numbered from 1 to n), and M means there are m roads. Next, m lines, each line shaped like "a, B, C" is used to represent a road, which means that city a is connected to city B, and the amount of money needed for management is C.
###Output format:
If you can reach all the cities through management, you can output the total amount of silver you need to spend at least. If you can't reach all the cities, output "impossible".
###Input example:
```in
3 3
1 2 1
1 3 2
2 3 4
```
###Output example:
```out
three
```
answer:If there is no answer, please comment