Joe is fond of computer games. Now, he must solve a puzzle. In front of him is a huge map with fortified towns. His enemy is a very powerful and cunning character who can connect and disconnect the towns using commands. Two towns are considered connected if they are directly connected or connected through other connected towns at any moment in time. When a town is disconnected, it becomes isolated; this erases all its connection history, but does not change the connection history of the other towns. Each connection is bidirectional. Initially, all towns are isolated. Joe is required to quickly answer whether two towns are connected, according to the history of the character's commands.
Write a program that, based on the input information, counts the number of yes answers and the number of no answers to the queries asking whether town[i] and town[j] are connected.
Each test case consists of a separate map and a set of character's commands:
The number of towns on the map (n \leq 10000);
A list of commands of the following types:
a) c town[i] town[j], where town[i] and town[j] are integers from to . This command connects town[i] and town[j].
b) d town[i], where town[i] is an integer from to . This command disconnects town[i].
c) q town[i] town[j], where town[i] and town[j] are integers from to . This is a query: are town[i] and town[j] connected?
d) e, which ends the list of commands.
Each command is given on a separate line. Commands (a), (b), (c) may appear in any order. The connectivity of towns changes after type (a) and (b) commands. Each (c) command is processed according to the current configuration.
Output the two numbers found on one line in the form: n[1], n[2], as shown in the example.
The given example corresponds to a map with fortified towns. The character gives commands. There are exactly yes answers and no answers.
Example 1