PROGRAMMING:Building roads
N villages, numbered from 1 to N, now please build some roads to connect any two villages. We say that village a and B are connected if and only if there is a road between a and B, or there is an existing C, so that there is a road between a and C, and C and B are connected< br/>
It is known that there are some roads between some villages. Your job is to build some more roads so that all villages are connected and the length of the roads built is the smallest.
###Input format:
The first line is an integer n (3 < = n < = 100), representing the number of villages. In the following n rows, the i-th row contains n integers. The j-th integer in the N integers is the distance between the i-th village and the j-th village, and the distance value is between [11000]< br/>
Then there is an integer Q (0 < = q < = n * (n + 1) / 2). In the following, row q is given. Each row contains two integers a and B (1 < = a < B < = n), indicating that a road has been built between village a and B.
###Output format:
There is only one integer in the output line, which represents the minimum length of the new road to connect all villages.
###Input example:
```in
three
0 990 692
990 0 179
692 179 0
one
1 2
```
###Output example:
```out
one hundred and seventy-nine
```
answer:If there is no answer, please comment
It is known that there are some roads between some villages. Your job is to build some more roads so that all villages are connected and the length of the roads built is the smallest.
###Input format:
The first line is an integer n (3 < = n < = 100), representing the number of villages. In the following n rows, the i-th row contains n integers. The j-th integer in the N integers is the distance between the i-th village and the j-th village, and the distance value is between [11000]< br/>
Then there is an integer Q (0 < = q < = n * (n + 1) / 2). In the following, row q is given. Each row contains two integers a and B (1 < = a < B < = n), indicating that a road has been built between village a and B.
###Output format:
There is only one integer in the output line, which represents the minimum length of the new road to connect all villages.
###Input example:
```in
three
0 990 692
990 0 179
692 179 0
one
1 2
```
###Output example:
```out
one hundred and seventy-nine
```
answer:If there is no answer, please comment