#include <bits/stdc++.h>
using namespace std;
struct data {
  string type;
  int val;
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> m;
  vector<data> ans;
  while (n--) {
    string s;
    cin >> s;
    if (s == "insert") {
      int val;
      cin >> val;
      ++m[val];
      ans.push_back({"insert", val});
    } else if (s == "getMin") {
      int val;
      cin >> val;
      if (m.empty()) {
        ans.push_back({"insert", val});
        ans.push_back({"getMin", val});
        ++m[val];
      } else {
        while (!m.empty() && m.begin()->first < val) {
          ans.push_back({"removeMin", 0});
          --m.begin()->second;
          if (m.begin()->second == 0) {
            m.erase(m.begin());
          }
        }
        if (m.empty() || m.begin()->first != val) {
          ans.push_back({"insert", val});
          ++m[val];
        }
        ans.push_back({"getMin", val});
      }
    } else {
      if (m.empty()) {
        ans.push_back({"insert", 0});
        ++m[0];
      }
      --m.begin()->second;
      if (m.begin()->second == 0) {
        m.erase(m.begin());
      }
      ans.push_back({"removeMin", 0});
    }
  }
  cout << (int)(ans).size() << "\n";
  for (auto& d : ans) {
    cout << d.type;
    if (d.type != "removeMin") {
      cout << " " << d.val;
    }
    cout << "\n";
  }
}
