#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k = 0;
  vector<pair<string, int>> ans;
  priority_queue<int, vector<int>, greater<int>> h;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string c;
    int x;
    cin >> c;
    if (c != "removeMin") cin >> x;
    if (c == "insert") {
      h.push(x);
      ans.push_back(make_pair("insert", x));
    }
    if (c == "getMin") {
      if (h.size() == 0) {
        ans.push_back(make_pair("insert", x));
        ans.push_back(make_pair("getMin", x));
        h.push(x);
      } else if (h.top() < x) {
        while (h.size() > 0 && h.top() < x) {
          ans.push_back(make_pair("removeMin", 0));
          h.pop();
        }
        if (h.size() == 0 || h.top() != x) {
          ans.push_back(make_pair("insert", x));
          h.push(x);
        }
        ans.push_back(make_pair("getMin", x));
      } else if (h.top() > x) {
        ans.push_back(make_pair("insert", x));
        ans.push_back(make_pair("getMin", x));
        h.push(x);
      } else {
        ans.push_back(make_pair("getMin", x));
      }
    }
    if (c == "removeMin") {
      if (h.size() == 0) {
        ans.push_back(make_pair("insert", 228));
        ans.push_back(make_pair(c, 0));
      } else {
        h.pop();
        ans.push_back(make_pair(c, 0));
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << ' ';
    if (ans[i].first[0] != 'r') cout << ans[i].second;
    cout << endl;
  }
}
