#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<string, long long> > q;
  priority_queue<long long> w;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    if (x == "insert") {
      long long y;
      cin >> y;
      w.push(-y);
      q.push_back({x, y});
    }
    if (x == "removeMin") {
      if (w.size() == 0) {
        q.push_back({"insert", 1e9});
        q.push_back({x, -(1e10)});
        continue;
      }
      w.pop();
      q.push_back({x, -(1e10)});
    }
    if (x == "getMin") {
      long long y;
      cin >> y;
      if (w.size() == 0) {
        q.push_back({"insert", y});
        q.push_back({x, y});
        w.push(-y);
        continue;
      }
      if (-y == w.top()) {
        q.push_back({x, y});
      } else if (-y > w.top()) {
        q.push_back({"insert", y});
        q.push_back({x, y});
        w.push(-y);
      } else {
        while (!w.empty()) {
          if (-y < w.top()) {
            w.pop();
            q.push_back({"removeMin", -(1e10)});
          } else {
            break;
          }
        }
        if (w.size() == 0) {
          q.push_back({"insert", y});
          q.push_back({x, y});
          w.push(-y);
        } else {
          if (w.top() == -y) {
            q.push_back({x, y});
          } else {
            q.push_back({"insert", y});
            q.push_back({x, y});
            w.push(-y);
          }
        }
      }
    }
  }
  cout << q.size() << endl;
  for (int i = 0; i < q.size(); i++) {
    if (q[i].second == -(1e10)) {
      cout << q[i].first << endl;
    } else {
      cout << q[i].first << " " << q[i].second << endl;
    }
  }
  return 0;
}
