#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  multiset<long long> v;
  vector<pair<string, long long>> ans;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "insert") {
      long long x;
      cin >> x;
      ans.push_back({"insert", x});
      v.insert(x);
    }
    if (s == "removeMin") {
      if (v.size() == 0) {
        ans.push_back({"insert", 1});
        v.insert(1);
      }
      ans.push_back({"removeMin", 0});
      v.erase(v.begin());
    }
    if (s == "getMin") {
      long long x;
      cin >> x;
      if (v.find(x) == v.end()) {
        ans.push_back({"insert", x});
        v.insert(x);
      }
      while (*(v.begin()) != x) {
        ans.push_back({"removeMin", 0});
        v.erase(v.begin());
      }
      ans.push_back({"getMin", x});
    }
  }
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << i.first << " ";
    if (i.first != "removeMin") {
      cout << i.second;
    }
    cout << '\n';
  }
}
