#include <bits/stdc++.h>
using namespace std;
vector<pair<string, int> > vec;
int n;
multiset<int> st;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    string s;
    cin >> s;
    if (s != "removeMin") scanf("%d", &x);
    if (s == "insert") {
      st.insert(x);
    }
    if (s == "removeMin") {
      if (st.size() == 0) {
        vec.push_back(make_pair("insert", 1));
      } else
        st.erase(st.begin());
    }
    if (s == "getMin") {
      while (*st.begin() < x && st.size() != 0) {
        st.erase(st.begin());
        vec.push_back(make_pair("removeMin", -1));
      }
      if (st.size() == 0 || *st.begin() != x) {
        vec.push_back(make_pair("insert", x));
        st.insert(x);
      }
    }
    vec.push_back(make_pair(s, x));
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i].first;
    if (vec[i].first != "removeMin") cout << " " << vec[i].second;
    cout << endl;
  }
  return 0;
}
