#include <bits/stdc++.h>
using namespace std;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long _a, long long _b) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long gcd(long long a, long long b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
long long lcm(long long a, long long b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
const string a = "insert", b = "getMin", c = "removeMin";
vector<string> ans1;
vector<long long> ans2;
int main() {
  long long n, i, j;
  cin >> n;
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s != c) {
      long long x;
      cin >> x;
      if (s == a) {
        pq.push(x);
        ans1.push_back(a);
        ans2.push_back(x);
      } else {
        if (!pq.empty()) {
          if (pq.top() < x) {
            while (pq.top() < x && !pq.empty()) {
              pq.pop();
              ans1.push_back(c);
              ans2.push_back(0x3f3f3f3f3f3f3f3fLL);
            }
            if (pq.empty()) {
              pq.push(x);
              ans1.push_back(a);
              ans2.push_back(x);
              ans1.push_back(b);
              ans2.push_back(x);
            } else {
              if (pq.top() == x) {
                ans1.push_back(b);
                ans2.push_back(x);
              } else {
                pq.push(x);
                ans1.push_back(a);
                ans2.push_back(x);
                ans1.push_back(b);
                ans2.push_back(x);
              }
            }
          } else if (pq.top() == x) {
            ans1.push_back(b);
            ans2.push_back(x);
          } else {
            pq.push(x);
            ans1.push_back(a);
            ans2.push_back(x);
            ans1.push_back(b);
            ans2.push_back(x);
          }
        } else {
          pq.push(x);
          ans1.push_back(a);
          ans2.push_back(x);
          ans1.push_back(b);
          ans2.push_back(x);
        }
      }
    } else {
      if (!pq.empty()) {
        pq.pop();
        ans1.push_back(c);
        ans2.push_back(0x3f3f3f3f3f3f3f3fLL);
      } else {
        ans1.push_back(a);
        ans2.push_back(1);
        ans1.push_back(c);
        ans2.push_back(0x3f3f3f3f3f3f3f3fLL);
      }
    }
  }
  cout << ans1.size() << endl;
  for (i = 0; i < ans1.size(); i++) {
    if (ans1[i] == c)
      cout << ans1[i] << endl;
    else
      cout << ans1[i] << " " << ans2[i] << endl;
  }
  return 0;
}
