Farmer John and Betsy are playing a game with N (1 ≤ N ≤ 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks Betsy to perform P (1≤ P ≤ 100,000) operation. There are two types of operations: moves and counts.
Write a program that can verify the results of the game.
Note that the value for N does not appear in the input file. No move operation will request a move a stack onto itself.
Print the output from each of the count operations in the same order as the input file.