#include <bits/stdc++.h>
using namespace std;
long long mexp(long long a, long long b) {
  long long ans = 1;
  a %= 1000000007;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    b >>= 1;
    a = a * a % 1000000007;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string q;
  long long x;
  multiset<long long> s;
  vector<pair<string, long long> > v;
  for (long long i = 0; i < n; ++i) {
    cin >> q;
    if (q[0] == 'r') {
      if ((long long)s.size() == 0) {
        v.push_back(make_pair("insert", 1));
      } else {
        s.erase(s.begin());
      }
      v.push_back(make_pair("removeMin", 0));
    } else {
      cin >> x;
      if (q[0] == 'i') {
        s.insert(x);
        v.push_back(make_pair("insert", x));
      } else {
        if (s.find(x) == s.end()) {
          v.push_back(make_pair("insert", x));
          s.insert(x);
        }
        auto it = s.lower_bound(x);
        while (s.begin() != it) {
          v.push_back(make_pair("removeMin", 0));
          s.erase(s.begin());
        }
        v.push_back(make_pair("getMin", x));
      }
    }
  }
  cout << (long long)v.size() << '\n';
  for (auto i : v) {
    if (i.first[0] != 'r') {
      cout << i.first << " " << i.second << '\n';
    } else {
      cout << i.first << '\n';
    }
  }
  cerr << 1.0 / CLOCKS_PER_SEC << endl;
  return 0;
}
