#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long double eps = 1e-9;
const long long maxn = 1e5 + 1;
const long long inf = 5e18;
const long long minf = -inf;
bool solve() {
  long long n;
  cin >> n;
  vector<string> ans;
  multiset<long long> have;
  for (long long i = 0; i < n; ++i) {
    string s;
    long long num;
    cin >> s;
    if (s == "insert") {
      cin >> num;
      have.insert(num);
      ans.push_back("insert " + to_string(num));
    }
    if (s == "getMin") {
      cin >> num;
      while (have.size() && *(have.begin()) < num) {
        have.erase(have.begin());
        ans.push_back("removeMin");
      }
      if (have.size() == 0 || *(have.begin()) > num) {
        have.insert(num);
        ans.push_back("insert " + to_string(num));
      }
      ans.push_back("getMin " + to_string(num));
    }
    if (s == "removeMin") {
      if (have.size() == 0) {
        ans.push_back("insert 1");
      } else {
        have.erase(have.begin());
      }
      ans.push_back("removeMin");
    };
  }
  cout << ans.size() << "\n";
  for (auto x : ans) cout << x << "\n";
  return true;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    if (solve()) {
    } else {
    }
  }
  return 0;
}
