Data Manager is a sophisticated data structure, which manages a set of data and fulfills operations on the data set. There are 3 kinds of operations:
Given a list of operations, you are to predict the output of the Data Manager. At the beginning, the Data Manager is empty.
There is only one test case. In the first line, an integer T (T <= 500000) will be given, which is the number of operations. The next T lines contains T operations.
Give output of the Data Manager, one query per line.