#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n, i, j, x, in = 0;
  string s;
  vector<pair<string, long long int>> v;
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      pq;
  cin >> n;
  long long int mn = 1000000000000000000LL, dummy = -1;
  for (i = 1; i <= n; i++) {
    cin >> s;
    if (s == "insert") {
      cin >> x;
      v.push_back(make_pair(s, x));
      pq.push(x);
    } else if (s == "getMin") {
      cin >> x;
      if (pq.size() != 0)
        mn = pq.top();
      else
        mn = -1;
      if (x != mn) {
        if (x > mn) {
          while (x > mn && pq.size() != 0) {
            mn = pq.top();
            if (mn >= x) break;
            pq.pop();
            v.push_back(make_pair("removeMin", -1));
          }
          if (x == mn && pq.size() != 0) {
            v.push_back(make_pair(s, x));
          } else if ((mn > x && pq.size() != 0) || pq.size() == 0) {
            v.push_back(make_pair("insert", x));
            pq.push(x);
            v.push_back(make_pair(s, x));
          }
        } else {
          v.push_back(make_pair("insert", x));
          pq.push(x);
          v.push_back(make_pair(s, x));
        }
      } else {
        v.push_back(make_pair(s, x));
      }
    } else if (s == "removeMin") {
      if (pq.size() != 0)
        pq.pop();
      else {
        v.push_back(make_pair("insert", 0));
      }
      v.push_back(make_pair(s, -1));
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) {
    cout << v[i].first << " ";
    if (v[i].first != "removeMin")
      cout << v[i].second << endl;
    else
      cout << endl;
  }
  return 0;
}
