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