#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const long long a, const long long b) { return a > b; }
};
vector<pair<int, int> > a;
priority_queue<long long, vector<long long>, cmp> q;
int main() {
  long long n;
  long long cnt = 0;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) {
    string str;
    long long x;
    cin >> str;
    if (str == "insert") {
      scanf("%lld", &x);
      q.push(x);
      cnt++;
      a.push_back(make_pair(1, x));
    } else if (str == "removeMin") {
      if (q.empty()) {
        q.push(2);
        cnt++;
        a.push_back(make_pair(1, 2));
      }
      q.pop();
      cnt++;
      a.push_back(make_pair(2, 1000000007));
    } else if (str == "getMin") {
      scanf("%lld", &x);
      while (!q.empty() && q.top() < x) {
        q.pop();
        cnt++;
        a.push_back(make_pair(2, 1000000007));
      }
      if (q.empty() || q.top() > x) {
        q.push(x);
        cnt++;
        a.push_back(make_pair(1, x));
      }
      cnt++;
      a.push_back(make_pair(3, x));
    }
  }
  cout << cnt << endl;
  int j = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i].first == 1) {
      cout << "insert " << a[i].second << endl;
      j++;
    } else if (a[i].first == 3) {
      cout << "getMin " << a[i].second << endl;
      j++;
    } else if (a[i].first == 2)
      cout << "removeMin" << endl;
  }
  return 0;
}
