#include <bits/stdc++.h>
using namespace std;
multiset<int> min_heap;
vector<pair<string, int>> my_answer;
const int mxN = 50;
string answer[] = {"insert", "removeMin", "getMin"};
char s[mxN];
int q;
int main() {
  cin >> q;
  while (q--) {
    cin >> s + 1;
    if (s[1] == 'i') {
      int x;
      cin >> x;
      min_heap.insert(x);
      my_answer.emplace_back(answer[0], x);
    } else if (s[1] == 'g') {
      int x;
      cin >> x;
      while (!min_heap.empty() && *min_heap.begin() != x &&
             *min_heap.begin() < x) {
        my_answer.emplace_back(answer[1], -1);
        min_heap.erase(min_heap.begin());
      }
      if (min_heap.empty() || *min_heap.begin() > x) {
        min_heap.insert(x);
        my_answer.emplace_back(answer[0], x);
      }
      my_answer.emplace_back(answer[2], x);
    } else {
      if (min_heap.empty()) {
        min_heap.insert(1);
        my_answer.emplace_back(answer[0], 1);
      }
      min_heap.erase(min_heap.begin());
      my_answer.emplace_back(answer[1], -1);
    }
  }
  cout << my_answer.size() << endl;
  for (pair<string, int> &cur : my_answer) {
    if (cur.first == answer[1]) {
      for (char &c : cur.first) cout << c;
    } else {
      for (int i = 0; i < (int)cur.first.size(); ++i) cout << cur.first[i];
      cout << " " << cur.second;
    }
    puts("");
  }
}
