#include <bits/stdc++.h>
using namespace std;
int n, x, y, ans;
string s;
multiset<int> st;
vector<pair<string, int> > v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s[0] == 'r') {
      if (!st.size()) st.insert(1e9), v.push_back({"insert", 1e9});
      st.erase(st.begin());
      v.push_back({"removeMin", 1e9 + 1});
      continue;
    }
    cin >> x;
    if (s[0] == 'i')
      st.insert(x), v.push_back({s, x});
    else {
      if (!st.size() || x < *st.begin())
        v.push_back({"insert", x}), st.insert(x);
      else if (x > *st.begin()) {
        while (st.size() && *st.begin() < x) {
          v.push_back({"removeMin", 1e9 + 1});
          st.erase(st.begin());
        }
        if ((st.size() && *st.begin() > x) || !st.size())
          v.push_back({"insert", x}), st.insert(x);
      }
      v.push_back({"getMin", x});
    }
  }
  cout << v.size() << "\n";
  for (auto p : v) {
    cout << p.first;
    if (p.second != 1e9 + 1) cout << " " << p.second;
    cout << "\n";
  }
}
