The first line contains two single integersand
, representing the depth of the full ternary tree and the number of operations, respectively.
In the nextlines, each line contains a single integer
, representing an operation that removes the subtree rooted at node labeled as
.
For each operation, output an integer in a single line that represents the number of nodes remaining in the tree after this operation.