#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
const int MIN = -1000000000;
priority_queue<int, vector<int>, greater<int> > PQ;
int n;
char str[110];
vector<pair<int, int> > V;
int read(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int tempa;
    scanf("%s", str);
    if (str[0] == 'i') {
      scanf("%d", &tempa);
      PQ.push(tempa);
      V.push_back(make_pair(0, tempa));
    } else if (str[0] == 'r') {
      if (PQ.empty()) {
        PQ.push(1);
        V.push_back(make_pair(0, 1));
      }
      PQ.pop();
      V.push_back(make_pair(1, 0));
    } else {
      scanf("%d", &tempa);
      while (!PQ.empty() && PQ.top() < tempa) {
        PQ.pop();
        V.push_back(make_pair(1, 0));
      }
      if (PQ.empty() || PQ.top() != tempa) {
        PQ.push(tempa);
        V.push_back(make_pair(0, tempa));
      }
      V.push_back(make_pair(2, tempa));
    }
  }
  return 0;
}
int init(void) { return 0; }
int solve(void) {
  printf("%d\n", V.size());
  for (int i = 0; i < V.size(); i++) {
    if (V[i].first == 0)
      printf("insert %d\n", V[i].second);
    else if (V[i].first == 1)
      printf("removeMin\n");
    else
      printf("getMin %d\n", V[i].second);
  }
  return 0;
}
int main(void) {
  read();
  init();
  solve();
  return 0;
}
