Shinku is very interested in the set. One day, she got sets, and the number is in the set. But she doesn’t think it is interesting enough, so she applies magic to these sets. There are three kinds of magic:
- : If the and numbers are not in one set, then the Shinku’s magic will merge the set containing the number and the set containing the number.
- : Shinku’s magic adds to each number in the set containing the number.
- : Shinku can immediately know how many numbers in the set containing the number satisfy .
But unfortunately, for some reason the type magic fails. So Shinku wants you to tell her the answer after every type magic.
Note that there can be multiple numbers with the same value in one set, that is, numbers with the same value will not disappear when merged.
The first line contains two integers , the number of initial sets and the number of the magic.
The second line contains integers. The number is the number in the set initially.
The next lines describe the sequence of magic. The line describes the magic. Each magic is a magic as described above.
After the first operation, the numbers are , sets are
For the second operation, the third number is in , , , so the answer is .
After the third operation, the numbers are , sets are
After the forth operation, the numbers are , sets are
For the fifth operation, ,the third number is in , , ,, so the answer is .
给定一个长为 的序列 ，起初第个数在第个集合。