#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double E = exp(1);
const double EPS = 1e-8;
const long long mod = 1000000000 + 7;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  vector<pair<string, int> > ans;
  priority_queue<int, vector<int>, greater<int> > que;
  int T;
  cin >> T;
  while (T--) {
    string c;
    int num;
    cin >> c;
    if (c != "removeMin") {
      cin >> num;
    }
    if (c == "insert") {
      que.push(num);
      ans.push_back(make_pair(c, num));
    } else if (c == "getMin") {
      while (!que.empty() && que.top() < num) {
        que.pop();
        ans.push_back(make_pair("removeMin", num));
      }
      if (que.empty() || que.top() != num) {
        que.push(num);
        ans.push_back(make_pair("insert", num));
      }
      ans.push_back(make_pair(c, num));
    } else {
      if (que.empty()) {
        ans.push_back(make_pair("insert", 10086));
      } else
        que.pop();
      ans.push_back(make_pair("removeMin", num));
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < (ans.size()); i++) {
    cout << ans[i].first << " ";
    if (ans[i].first != "removeMin") cout << ans[i].second;
    cout << endl;
  }
  return 0;
}
