Petya has recently learned data structure named "Binary heap".

The heap he is now operating with allows the following operations: 
 -  put the given number into the heap; -  get the value of the minimum element in the heap; -  extract the minimum element from the heap; 
Thus, at any moment of time the heap contains several integers (possibly none), some of them might be equal.

In order to better learn this data structure Petya took an empty heap and applied some operations above to it. Also, he carefully wrote down all the operations and their results to his event log, following the format: 
 -  insert *x* — put the element with value *x* in the heap; -  getMin *x* — the value of the minimum element contained in the heap was equal to *x*; -  removeMin — the minimum element was extracted from the heap (only one instance, if there were many). 
All the operations were correct, i.e. there was at least one element in the heap each time getMin or removeMin operations were applied.

While Petya was away for a lunch, his little brother Vova came to the room, took away some of the pages from Petya's log and used them to make paper boats.

Now Vova is worried, if he made Petya's sequence of operations inconsistent. For example, if one apply operations one-by-one in the order they are written in the event log, results of getMin operations might differ from the results recorded by Petya, and some of getMin or removeMin operations may be incorrect, as the heap is empty at the moment they are applied.

Now Vova wants to add some new operation records to the event log in order to make the resulting sequence of operations correct. That is, the result of each getMin operation is equal to the result in the record, and the heap is non-empty when getMin ad removeMin are applied. Vova wants to complete this as fast as possible, as the Petya may get back at any moment. He asks you to add the least possible number of operation records to the current log. Note that arbitrary number of operations may be added at the beginning, between any two other operations, or at the end of the log.
The first line of the input contains the only integer *n* (1 ≤ *n* ≤ 100 000) — the number of the records left in Petya's journal.

Each of the following *n* lines describe the records in the current log in the order they are applied. Format described in the statement is used. All numbers in the input are integers not exceeding 10<sup class="upper-index">9</sup> by their absolute value.
In the first sample, after number 3 is inserted into the heap, the minimum number is 3. To make the result of the first getMin equal to 4 one should firstly remove number 3 from the heap and then add number 4 into the heap.

In the second sample case number 1 is inserted two times, so should be similarly removed twice.
2
insert 3
getMin 4
4
insert 3
removeMin
insert 4
getMin 4
4
insert 1
insert 1
removeMin
getMin 2
6
insert 1
insert 1
removeMin
removeMin
insert 2
getMin 2
1
insert 1
1
insert 1
1
getMin 31
2
insert 31
getMin 31
1
removeMin
2
insert 0
removeMin
2
insert 2
getMin 2
2
insert 2
getMin 2
2
insert 31
removeMin
2
insert 31
removeMin
2
getMin 31
removeMin
3
insert 31
getMin 31
removeMin
2
removeMin
getMin 31
4
insert 0
removeMin
insert 31
getMin 31
8
insert 219147240
removeMin
getMin 923854124
removeMin
getMin -876779400
removeMin
insert 387686853
getMin 749998368
12
insert 219147240
removeMin
insert 923854124
getMin 923854124
removeMin
insert -876779400
getMin -876779400
removeMin
insert 387686853
removeMin
insert 749998368
getMin 749998368
2
removeMin
insert 450653162
3
insert 0
removeMin
insert 450653162
6
insert -799688192
getMin 491561656
removeMin
insert -805250162
insert -945439443
removeMin
8
insert -799688192
removeMin
insert 491561656
getMin 491561656
removeMin
insert -805250162
insert -945439443
removeMin
30
insert 62350949
getMin -928976719
removeMin
getMin 766590157
getMin -276914351
insert 858958907
getMin -794653029
getMin 505812710
getMin -181182543
insert -805198995
removeMin
insert -200361579
removeMin
insert 988531216
insert -474257426
insert 579296921
removeMin
insert -410043658
getMin 716684155
removeMin
getMin -850837161
getMin 368670814
insert 579000842
removeMin
getMin -169833018
insert 313148949
removeMin
removeMin
getMin 228901059
getMin 599172503
52
insert 62350949
insert -928976719
getMin -928976719
removeMin
removeMin
insert 766590157
getMin 766590157
insert -276914351
getMin -276914351
insert 858958907
insert -794653029
getMin -794653029
removeMin
removeMin
insert 505812710
getMin 505812710
insert -181182543
getMin -181182543
insert -805198995
removeMin
insert -200361579
removeMin
insert 988531216
insert -474257426
insert 579296921
removeMin
insert -410043658
removeMin
removeMin
removeMin
removeMin
insert 71668415...
9
insert 3
insert 4
insert 5
removeMin
getMin 3
removeMin
getMin 4
removeMin
getMin 5
10
insert 3
insert 4
insert 5
removeMin
insert 3
getMin 3
removeMin
getMin 4
removeMin
getMin 5
9
insert 3
insert 4
insert 5
removeMin
getMin 5
removeMin
getMin 4
removeMin
getMin 3
12
insert 3
insert 4
insert 5
removeMin
removeMin
getMin 5
removeMin
insert 4
getMin 4
removeMin
insert 3
getMin 3
1
getMin 0
2
insert 0
getMin 0
3
insert 3
insert 4
getMin 4
4
insert 3
insert 4
removeMin
getMin 4
3
insert 1
insert 2
getMin 2
4
insert 1
insert 2
removeMin
getMin 2
3
insert -1
insert 0
getMin 0
4
insert -1
insert 0
removeMin
getMin 0
2
insert 0
getMin 0
2
insert 0
getMin 0
1
insert -1
1
insert -1
3
insert 1
insert 0
getMin 1
4
insert 1
insert 0
removeMin
getMin 1
from heapq import heappush, heappop

heap = []
cmdNum = int(input())
cmdList = []

for _ in range(cmdNum):
	cmdStr = input()
	cmdArr = cmdStr.split()
	cmd = cmdArr[0]

	if(cmd == 'removeMin'):
		if(len(heap) == 0):
			cmdList.append("insert 0")
			heappush(heap, 0)
			
		heappop(heap)
		cmdList.append(cmdStr)
		
	if(cmd == 'insert'):
		num = int(cmdArr[1])
		heappush(heap, num)
		cmdList.append(cmdStr)
		
	if(cmd == 'getMin'):
		num = int(cmdArr[1])
		
		if(len(heap) == 0):
			cmdList.append("insert "+ str(num))
			heappush(heap, num)
		
		while(heap[0] != num):
			if(heap[0] < num):
				cmdList.append("removeMin")
				heappop(heap)
				
			if(len(heap) == 0 or heap[0] > num):
				cmdList.append("insert "+ str(num))
				heappush(heap, num)
				

		cmdList.append(cmdStr)

print(len(cmdList))
print(*cmdList, sep = "\n")
				 			    				 				 		 	 	