#include <bits/stdc++.h>
using namespace std;
vector<pair<string, int> > p;
int main() {
  priority_queue<int> heap;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int x;
    if (s != "removeMin") scanf(" %d", &x);
    if (s == "insert") {
      heap.push(x * -1);
      p.push_back(make_pair("insert", x));
    }
    if (s == "removeMin") {
      if (heap.empty()) {
        heap.push(0);
        p.push_back(make_pair("insert", 0));
      }
      heap.pop();
      p.push_back(make_pair("removeMin", 0));
    }
    if (s == "getMin") {
      bool f = true;
      while (!heap.empty()) {
        if (heap.top() * -1 == x) {
          f = false;
          break;
        } else if (x <= heap.top() * -1) {
          p.push_back(make_pair("insert", x));
          heap.push(x * -1);
          f = false;
          break;
        } else {
          heap.pop();
          p.push_back(make_pair("removeMin", 0));
        }
      }
      if (f) {
        p.push_back(make_pair("insert", x));
        heap.push(x * -1);
      }
      p.push_back(make_pair("getMin", x));
    }
  }
  cout << p.size() << endl;
  for (int i = 0; i < p.size(); i++) {
    cout << p[i].first;
    if (p[i].first != "removeMin") printf(" %d", p[i].second);
    printf("\n");
  }
  return 0;
}
