Joe is fond of computer games. He is now facing a large map dotted with fortified towns. His opponent can issue commands that connect or disconnect towns.
Think of the towns as being organized into groups. Two towns are connected exactly when they belong to the same group. Initially every town sits alone in its own group and is isolated.
Between the opponent's commands, questions of the form "is town $i$ connected with town $j$?" appear. Write a program that counts how many questions are answered "yes" and how many are answered "no".
The input may contain several data sets; each data set describes one map together with its commands, in the following form:
c i j — merge the groups containing towns $i$ and $j$ ($1 \le i, j \le N$).d i — remove town $i$ from its group, isolating it ($1 \le i \le N$).q i j — the question: is town $i$ connected with town $j$? ($1 \le i, j \le N$).e — marks the end of the current data set's command list.The c, d, and q commands may appear in any order, and each command is processed against the current configuration. Several data sets may follow one another until the end of the file.
For each data set, print on one line the number of questions answered "yes", $N_1$, and the number answered "no", $N_2$. Write the two numbers in the form N_1 , N_2, separated by a space, a comma, and a space (,). For instance, the data set in the example below has 2 "yes" answers and 2 "no" answers, so it prints 2 , 2.