#include <bits/stdc++.h>
using namespace std;
struct operacion {
  string name;
  int x;
  operacion() {}
  operacion(string name, int x) : name(name), x(x) {}
};
int n;
priority_queue<int, vector<int>, greater<int> > q;
vector<operacion> v;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int cas = 0; cas < n; cas++) {
    string name;
    cin >> name;
    if (name == "insert") {
      int x;
      cin >> x;
      v.push_back(operacion(name, x));
      q.push(x);
    } else if (name == "getMin") {
      int x;
      cin >> x;
      while (int(q.size()) > 0 and q.top() < x) {
        v.push_back(operacion("removeMin", 0));
        q.pop();
      }
      if (int(q.size()) == 0 or q.top() != x) {
        v.push_back(operacion("insert", x));
        q.push(x);
      }
      v.push_back(operacion("getMin", x));
    } else if (name == "removeMin") {
      if (int(q.size()) == 0) {
        v.push_back(operacion("insert", 1));
        q.push(1);
      }
      v.push_back(operacion("removeMin", 0));
      q.pop();
    }
  }
  cout << int(v.size()) << endl;
  for (int i = 0; i < int(v.size()); i++) {
    cout << v[i].name;
    if (v[i].name != "removeMin") cout << " " << v[i].x;
    cout << endl;
  }
}
