#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<char, long long> > v;
  multiset<long long> ms;
  for (__typeof(n) i = 0; i < n; i++) {
    string s;
    int temp;
    cin >> s;
    if (s[0] != 'r') {
      cin >> temp;
    }
    if (s[0] == 'i') {
      v.push_back(make_pair('i', temp));
      ms.insert(temp);
    } else if (s[0] == 'g') {
      if (ms.empty() == true || *(ms.begin()) > temp) {
        v.push_back(make_pair('i', temp));
        v.push_back(make_pair('g', temp));
        ms.insert(temp);
      } else {
        while (ms.empty() == false && *(ms.begin()) < temp) {
          v.push_back(make_pair('r', -1));
          ms.erase(ms.begin());
        }
        if (ms.empty() == false && *(ms.begin()) == temp) {
          v.push_back(make_pair('g', temp));
        } else {
          v.push_back(make_pair('i', temp));
          v.push_back(make_pair('g', temp));
          ms.insert(temp);
        }
      }
    } else {
      if (ms.empty() == false) {
        v.push_back(make_pair('r', -1));
        ms.erase(ms.begin());
      } else {
        v.push_back(make_pair('i', 1));
        v.push_back(make_pair('r', -1));
      }
    }
  }
  cout << v.size() << '\n';
  for (__typeof(v.size()) i = 0; i < v.size(); i++) {
    if (v[i].first == 'r') {
      cout << "removeMin\n";
    } else if (v[i].first == 'g') {
      cout << "getMin " << v[i].second << '\n';
    } else {
      cout << "insert " << v[i].second << '\n';
    }
  }
  return 0;
}
