Problem G
Accelerated Compulsive Meteors
You have just started playing a new space-based role playing game Galaxy War Online. The evil empire has been reigning the universe for too long and a new coalition has been forming to try and knock the empire out of power. You are a commander in the new coalition in charge of the Accelerated Compulsive Meteors Brigade (or ACM for short). As part of your role as commander, you must keep track of your sub-brigades while they are in battle. You must be able to show a snapshot of your brigade to show your superiors the state of the brigade.
Your brigade is structured in a hierarchical way:
-
At the top of the brigade is you.
-
You have two lieutenants who are under you.
-
Each lieutenant is in command of two sub-brigades, each with one Captain.
-
Each captain is in control of two areas, each with one sub-captain.
-
Each sub-captain has two floats, and each float has two pilots, each pilot has two sub-pilots and so on.
Your brigade is divided into $n$ levels. The first level is you, and the front line of defense is level $n$. As seen in the structure above, each level has twice the number of people as the level before it. The hierarchy is indexed as follows: as commander, you stand at the top of the hierarchy, so you are number 1. Your two lieutenants are numbers 2 (to your left) and 3 (to your right). Under number 2 are 4 (to its left) and 5 (to its right) and under number 3 are 6 (to its left) and 7 (to its right).
As the war happens you must update the state of your brigade. As certain people in your brigade get eliminated by the enemy forces, everyone under them will be eliminated with them. You must keep track of your brigade as these eliminations happen and be ready to show it to your bosses.
Input
The first line of input contains the integer $n$ ($1 \leq n \leq 10^4$), the number of people in your brigade. This means that every person with id between $1$ and $n$ inclusive are part of your brigade, in the structure described above.
The following line contains an integer $q$ ($1 \leq q \leq 101$), the number of commands to execute.
Each of the $q$ lines after that have one of the two commands: Eliminate or Status.
Eliminate commands are followed by an integer corresponding to the id of who has been eliminated. When a commander is eliminated, all of the troops under their command are also eliminated.
Status asks you to print the status of your brigade by printing each member left in your brigade on their own line in increasing order of id.
There will be at most $10$ Status commands.
Output
For each Status command, print the id of every person in your brigade left alive in increasing order.
| Sample Input 1 | Sample Output 1 |
|---|---|
7 2 Eliminate 2 Status |
1 3 6 7 |
| Sample Input 2 | Sample Output 2 |
|---|---|
4 2 Eliminate 2 Status |
1 3 |
