#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > pq;
vector<pair<int, int> > ans;
int n, x;
string s;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (s == "insert") {
      cin >> x;
      pq.push(x);
      ans.push_back(make_pair(1, x));
    } else if (s == "removeMin") {
      if (pq.empty()) {
        ans.push_back(make_pair(1, 1));
      } else {
        pq.pop();
      }
      ans.push_back(make_pair(2, -1));
    } else {
      cin >> x;
      if (pq.empty()) {
        pq.push(x);
        ans.push_back(make_pair(1, x));
      } else if (x != pq.top()) {
        while (x > pq.top() && !pq.empty()) {
          pq.pop();
          ans.push_back(make_pair(2, -1));
        }
        if (pq.empty()) {
          pq.push(x);
          ans.push_back(make_pair(1, x));
        } else if (x != pq.top()) {
          pq.push(x);
          ans.push_back(make_pair(1, x));
        }
      }
      ans.push_back(make_pair(3, x));
    }
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); ++i) {
    if (ans[i].first == 1) {
      cout << "insert " << ans[i].second;
    } else if (ans[i].first == 2) {
      cout << "removeMin";
    } else {
      cout << "getMin " << ans[i].second;
    }
    cout << '\n';
  }
  return 0;
}
