#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 4;
int n, m, ans[maxn], cnt = 0;
string ope;
vector<string> v;
priority_queue<int, vector<int>, greater<int> > q;
string s[3] = {"insert", "getMin", "removeMin"};
int main() {
  ios::sync_with_stdio(false);
  int i, j, k, kase;
  v.clear();
  while (q.size()) q.pop();
  cin >> n;
  while (n--) {
    cin >> ope;
    if (ope == "insert") {
      cin >> m;
      q.push(m);
      v.push_back(string("insert"));
      ans[cnt++] = m;
    } else if (ope == "getMin") {
      cin >> m;
      if (q.size() == 0) {
        q.push(m);
        v.push_back(s[0]);
        ans[cnt++] = m;
        v.push_back(s[1]);
        ans[cnt++] = m;
      } else if (q.top() == m) {
        v.push_back(string("getMin"));
        ans[cnt++] = m;
      } else if (q.top() > m) {
        q.push(m);
        v.push_back(s[0]);
        ans[cnt++] = m;
        v.push_back(s[1]);
        ans[cnt++] = m;
      } else if (q.top() < m) {
        while (q.size() && q.top() < m) {
          v.push_back(s[2]);
          q.pop();
          cnt++;
        }
        if (q.size() == 0 || q.top() > m) {
          q.push(m);
          v.push_back(s[0]);
          ans[cnt++] = m;
          v.push_back(s[1]);
          ans[cnt++] = m;
        } else if (q.top() == m) {
          v.push_back(string("getMin"));
          ans[cnt++] = m;
        }
      }
    } else if (ope == s[2]) {
      if (q.size()) {
        v.push_back(s[2]);
        q.pop();
        cnt++;
      } else {
        v.push_back(s[0]);
        ans[cnt++] = 1;
        v.push_back(s[2]);
        cnt++;
      }
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); ++i) {
    cout << v[i];
    if (v[i] != s[2]) cout << ' ' << ans[i];
    cout << endl;
  }
  return 0;
}
