Hayama Mizuki is learning English and discovers an interesting linguistic pattern: the word "ever" appears as a suffix in "forever". Inspired by this, she creates a dynamic vocabulary system and poses a challenge to you.
Formally, she maintains a vocabulary list that undergoes the following operations:
$$$^{\text{∗}}$$$A string $$$a$$$ is a suffix of a string $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by deletion of several (possibly, zero or all) characters from the beginning. For example, "ever" is a suffix of "forever", but "abc" is not a suffix of "aabbc"
The first line contains one integer $$$n$$$ ($$$1\le n\le 10^5$$$) — the number of operations that Mizuki does.
Each of the following $$$n$$$ lines contains $$$n$$$ operations. Each operation is one of the two types:
Note that a removed word can be readded into the vocabulary.
It is guaranteed that the sum of $$$|s|$$$ over all operations doesn't exceed $$$10^6$$$.
Output $$$q$$$ integers. Each integer indicates the answer after Mizuki's each operation.
10+ ever+ never+ forever+ er- never+ rever+ never+ father- er+ mother
0 1 2 5 3 6 8 9 4 4