#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, d;
  priority_queue<int, vector<int>, greater<int> > q;
  vector<string> ans;
  cin >> n;
  string op;
  for (int i = 0; i < n; i++) {
    cin >> op;
    if ((op == "insert")) {
      cin >> d;
      q.push(d);
      ans.push_back("insert " + to_string(d));
    } else if ((op == "getMin")) {
      cin >> d;
      while (!q.empty() && q.top() < d) {
        q.pop();
        ans.push_back("removeMin");
      }
      if (!q.empty() && q.top() == d)
        ;
      else {
        q.push(d);
        ans.push_back("insert " + to_string(d));
      }
      ans.push_back("getMin " + to_string(d));
    } else {
      if (q.empty())
        ans.push_back("insert 0");
      else
        q.pop();
      ans.push_back("removeMin");
    }
  }
  cout << ans.size() << "\n";
  for (int cnt = 0; cnt < ans.size(); cnt++) cout << ans[cnt] << "\n";
  return 0;
}
