#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > que;
string ss[1000050];
int nums[1000050];
int main() {
  int n;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  while (cin >> n) {
    while (!que.empty()) que.pop();
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      string s;
      int num;
      cin >> s;
      if (s == "insert") {
        cin >> num;
        que.push(num);
        ss[++cnt] = "insert";
        nums[cnt] = num;
      }
      if (s == "getMin") {
        cin >> num;
        int now;
        int flag = 0;
        while ((!que.empty()) && (que.top() < num)) {
          que.pop();
          ss[++cnt] = "removeMin";
          nums[cnt] = 0x3f3f3f3f;
        }
        if (que.size() == 0) {
          flag = 1;
        } else
          now = que.top();
        if (now > num || flag) {
          que.push(num);
          ss[++cnt] = "insert";
          nums[cnt] = num;
        }
        ss[++cnt] = "getMin";
        nums[cnt] = num;
      }
      if (s == "removeMin") {
        if (que.size() == 0) {
          que.push(1);
          ss[++cnt] = "insert";
          nums[cnt] = 1;
        }
        que.pop();
        ss[++cnt] = "removeMin";
        nums[cnt] = 0x3f3f3f3f;
      }
    }
    cout << cnt << endl;
    for (int i = 1; i <= cnt; i++) {
      cout << ss[i];
      if (ss[i] == "removeMin") {
        cout << "\n";
        continue;
      }
      cout << " " << nums[i] << endl;
    }
  }
}
