| acmsguru |
|---|
| Finished |
). The next m lines describe the roads of the kingdom. Each of these lines contains two integer numbers xi and yi — 1-based indices of cities connected by this road. The following lines describe queries of the government and information about road destruction. If the line describes a destruction of the road, it will be formatted as "DELETE x", where x is 1-based index of the road. Otherwise it will be formated as "LENGTH x y", where x and y are 1-based indices of cities. The queries will appear in the input till the end of the file. The total number of queries doesn't exceed
.LENGTH" query output the answer on the separate line, or -1 if there's no way to travel from one city to another.
sample input | sample output |
3 3 1 2 2 3 3 1 LENGTH 1 2 DELETE 1 LENGTH 1 2 LENGTH 2 3 DELETE 3 LENGTH 1 2 | 1 2 1 -1 |
| Name |
|---|


