#include <bits/stdc++.h>
using namespace std;
char ans[1000010][35];
int main() {
  priority_queue<int, vector<int>, greater<int> > Q;
  char ch[10];
  int num;
  int n, pos = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s%d", ch, &num);
    if (strcmp(ch, "insert") == 0) {
      Q.push(num);
      sprintf(ans[pos++], "%s %d", "insert", num);
    } else if (strcmp(ch, "getMin") == 0) {
      if (Q.empty()) {
        sprintf(ans[pos++], "%s %d", "insert", num);
        Q.push(num);
      } else if (num != Q.top()) {
        while (!Q.empty() && num > Q.top()) {
          sprintf(ans[pos++], "%s", "removeMin");
          Q.pop();
        }
        if (Q.empty() || Q.top() != num) {
          Q.push(num);
          sprintf(ans[pos++], "%s %d", "insert", num);
        }
      }
      sprintf(ans[pos++], "%s %d", "getMin", num);
    } else {
      if (!Q.empty()) {
        Q.pop();
        sprintf(ans[pos++], "%s", "removeMin");
      } else {
        sprintf(ans[pos++], "%s %d", "insert", 0);
        sprintf(ans[pos++], "%s", "removeMin");
      }
    }
  }
  printf("%d\n", pos);
  for (int i = 0; i < pos; i++) printf("%s\n", ans[i]);
  return 0;
}
