#include <bits/stdc++.h>
using namespace std;
bool checkbitt(long long int num, int pos);
long long int setbitt(long long int num, long long int pos);
long long int resetbitt(long long int num, int pos);
struct cmp {
  bool operator()(long long int a, long long int b) { return a > b; }
};
int solve() {
  long long int n;
  cin >> n;
  priority_queue<long long int, vector<long long int>, cmp> q;
  vector<pair<long long int, long long int> > state;
  while (n--) {
    string order;
    cin >> order;
    if (order == "insert") {
      long long int x;
      cin >> x;
      q.push(x);
      state.push_back({1, x});
    } else if (order == "getMin") {
      long long int x;
      cin >> x;
      bool f = false;
      if (q.empty()) {
        q.push(x);
        state.push_back({1, x});
      } else if (q.top() == x) {
        state.push_back({3, x});
        continue;
      } else {
        while (q.size() && q.top() < x) {
          state.push_back({2, -1});
          q.pop();
        }
        if (q.top() != x) {
          q.push(x);
          state.push_back({1, x});
        }
      }
      state.push_back({3, x});
    } else {
      if (q.size()) {
        q.pop();
      } else {
        state.push_back({1, 0});
      }
      state.push_back({2, -1});
    }
  }
  cout << state.size() << endl;
  for (auto x : state) {
    if (x.first == 1) {
      cout << "insert"
           << " " << x.second << endl;
    } else if (x.first == 2) {
      cout << "removeMin" << endl;
    } else
      cout << "getMin"
           << " " << x.second << endl;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int cs = 1;
  int cn = 1;
  while (cs--) {
    solve();
  }
}
bool checkbitt(long long int num, int pos) { return (num >> pos) & 1; }
long long int setbitt(long long int num, long long int pos) {
  return (1 << pos) | num;
}
long long int resetbitt(long long int num, int pos) {
  if (!checkbitt(num, pos))
    return num;
  else
    return (1 << pos) ^ num;
}
