#include <bits/stdc++.h>
using namespace std;
vector<pair<string, int>> afis;
priority_queue<int, vector<int>, greater<int>> pq;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string op;
    int nr;
    cin >> op;
    if (op == "insert") {
      cin >> nr;
      pq.push(nr);
      afis.push_back(make_pair("insert", nr));
    } else if (op == "removeMin") {
      if (pq.empty()) afis.push_back(make_pair("insert", 0));
      afis.push_back(make_pair("removeMin", 0));
      if (!pq.empty()) pq.pop();
    } else {
      cin >> nr;
      while (!pq.empty() && pq.top() < nr) {
        afis.push_back(make_pair("removeMin", 0));
        pq.pop();
      }
      if (pq.empty() || pq.top() > nr) {
        afis.push_back(make_pair("insert", nr));
        pq.push(nr);
      }
      afis.push_back(make_pair("getMin", nr));
    }
  }
  cout << afis.size() << "\n";
  for (auto it : afis) {
    if (it.first == "removeMin")
      cout << it.first << "\n";
    else
      cout << it.first << " " << it.second << "\n";
  }
  return 0;
}
