#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  multiset<int> s;
  vector<pair<string, int> > ans;
  int n, i, value;
  string type;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> type;
    if (type == "removeMin") {
      if (s.empty()) {
        s.insert(1);
        ans.push_back(make_pair("insert", 1));
      }
      s.erase(s.begin());
      ans.push_back(make_pair("removeMin", 0));
    } else if (type == "insert") {
      cin >> value;
      s.insert(value);
      ans.push_back(make_pair("insert", value));
    } else if (type == "getMin") {
      cin >> value;
      while (!s.empty() && *s.begin() < value) {
        s.erase(s.begin());
        ans.push_back(make_pair("removeMin", 0));
      }
      if (s.empty() || *s.begin() != value) {
        s.insert(value);
        ans.push_back(make_pair("insert", value));
      }
      ans.push_back(make_pair("getMin", value));
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) {
    if (ans[i].first == "removeMin")
      cout << "removeMin" << endl;
    else
      cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
