#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384626433832795;
const long long INF = 1e9 + 7;
const double EPS = 1 / 1e9;
const long long MOD = 1000000007;
const int N = 100002;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
void solve() {
  int n;
  string s;
  int x;
  vector<pair<string, int>> a;
  int no_x = 2e9;
  priority_queue<int> q;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "insert") {
      cin >> x;
      q.push(-x);
      a.push_back(make_pair(s, x));
    } else if (s == "getMin") {
      cin >> x;
      while (!q.empty() && (-q.top()) < x) {
        q.pop();
        a.push_back(make_pair("removeMin", no_x));
      }
      if (q.empty() || (-q.top()) > x) {
        q.push(-x);
        a.push_back(make_pair("insert", x));
      }
      a.push_back(make_pair(s, x));
    } else {
      if (q.empty())
        a.push_back(make_pair("insert", 0));
      else
        q.pop();
      a.push_back(make_pair(s, no_x));
    }
  }
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].first;
    if (a[i].first != "removeMin") cout << " " << a[i].second;
    cout << endl;
  }
}
int main() {
  int k1 = 1;
  while (k1--) solve();
  return 0;
}
