#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int, vector<int>, greater<int> > Q;
  int n;
  cin >> n;
  char s[20];
  vector<pair<string, int> > ans;
  int minn = (1 << 30);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    if (strcmp(s, "insert") == 0) {
      int c;
      scanf("%d", &c);
      ans.push_back(make_pair("insert", c));
      Q.push(c);
    } else if (strcmp(s, "getMin") == 0) {
      int c;
      scanf("%d", &c);
      while (!Q.empty() && Q.top() < c) {
        Q.pop();
        ans.push_back(make_pair("removeMin", -1));
      }
      if (Q.empty() || Q.top() > c) {
        ans.push_back(make_pair("insert", c));
        Q.push(c);
      }
      ans.push_back(make_pair("getMin", c));
    } else {
      if (Q.empty()) {
        ans.push_back(make_pair("insert", -100000000));
      } else
        Q.pop();
      ans.push_back(make_pair("removeMin", -1));
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i].first == "removeMin") {
      puts("removeMin");
      continue;
    } else
      printf("%s %d\n", ans[i].first.c_str(), ans[i].second);
  }
  return 0;
}
