#include <bits/stdc++.h>
using namespace std;
int n;
multiset<int> ss;
char buf[100];
vector<pair<char, int> > vv;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %s", buf);
    int x;
    if (buf[0] == 'i') {
      scanf("%d", &x);
      ss.insert(x);
      vv.push_back(make_pair('i', x));
    } else if (buf[0] == 'g') {
      scanf("%d", &x);
      while (!ss.empty() && *ss.begin() < x)
        vv.push_back(make_pair('r', 0)), ss.erase(ss.begin());
      if (ss.empty() || *ss.begin() > x)
        vv.push_back(make_pair('i', x)), ss.insert(x);
      vv.push_back(make_pair('g', x));
    } else {
      if (ss.empty()) ss.insert(1), vv.push_back(make_pair('i', 1));
      ss.erase(ss.begin());
      vv.push_back(make_pair('r', 0));
    }
  }
  printf("%d\n", (int)vv.size());
  for (auto i : vv) {
    if (i.first == 'i')
      printf("insert %d\n", i.second);
    else if (i.first == 'g')
      printf("getMin %d\n", i.second);
    else
      printf("removeMin\n");
  }
  return 0;
}
