#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238463;
void printVec(vector<int> v1) {
  for (int i = 0; i < v1.size(); i++) cout << v1[i] << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  priority_queue<long long, vector<long long>, greater<long long>> pQ;
  long long n;
  cin >> n;
  string s;
  long long opr;
  vector<string> vec;
  vector<long long> operations;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    vec.push_back(s);
    if (s == "removeMin") {
      operations.push_back(-1);
      continue;
    }
    cin >> opr;
    operations.push_back(opr);
  }
  vector<string> vec_Out;
  vector<long long> operations_Out;
  for (long long i = 0; i < n; i++) {
    if (vec[i] == "removeMin") {
      if (pQ.empty()) {
        pQ.push(0);
        vec_Out.push_back("insert ");
        operations_Out.push_back(0);
      }
      pQ.pop();
      vec_Out.push_back("removeMin");
      operations_Out.push_back(-1);
    } else if (vec[i][0] == 'i') {
      vec_Out.push_back("insert ");
      operations_Out.push_back(operations[i]);
      pQ.push(operations[i]);
    } else {
      opr = operations[i];
      long long MIN = -2;
      if (!pQ.empty()) {
        MIN = pQ.top();
      }
      while (opr != MIN && !pQ.empty() && opr > MIN) {
        pQ.pop();
        if (!pQ.empty()) {
          MIN = pQ.top();
        }
        vec_Out.push_back("removeMin");
        operations_Out.push_back(-1);
      }
      if (pQ.empty() || opr < MIN) {
        pQ.push(opr);
        vec_Out.push_back("insert ");
        operations_Out.push_back(opr);
      }
      vec_Out.push_back("getMin ");
      operations_Out.push_back(opr);
    }
  }
  cout << vec_Out.size() << endl;
  for (long long i = 0; i < vec_Out.size(); i++) {
    if (vec_Out[i] == "removeMin") {
      cout << vec_Out[i] << endl;
      continue;
    }
    cout << vec_Out[i] << operations_Out[i] << endl;
  }
  vec_Out.clear();
  vec.clear();
  operations.clear();
  operations_Out.clear();
  return 0;
}
