#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      pq;
  vector<pair<string, long long int>> ans;
  string s;
  long long int x;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    if (s == "removeMin") {
      if (pq.empty()) {
        ans.push_back({"insert", -1000000000});
        pq.push(-10000000000);
      }
      pq.pop();
      ans.push_back({s, INT_MIN});
      continue;
    }
    cin >> x;
    if (s == "insert") {
      pq.push(x);
      ans.push_back({s, x});
      continue;
    } else if (s == "getMin") {
      if (!pq.empty() && pq.top() == x) {
        ans.push_back({s, x});
        continue;
      } else if (!pq.empty() && pq.top() < x) {
        while (!pq.empty() && pq.top() < x) {
          ans.push_back({"removeMin", INT_MIN});
          pq.pop();
        }
      }
      if (!pq.empty() && pq.top() == x)
        ;
      else {
        ans.push_back({"insert", x});
        pq.push(x);
      }
      ans.push_back({s, x});
    }
  }
  cout << ans.size() << endl;
  for (long long int i = 0; i < ans.size(); i++) {
    if (ans[i].first == "removeMin")
      cout << ans[i].first << endl;
    else
      cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
