#include <bits/stdc++.h>
using namespace std;
string itoa(int x) {
  string s = "";
  char c;
  if (x < 0) x *= -1, s += "-";
  while (x) {
    c = x % 10 + 48;
    s += c;
    x /= 10;
  }
  if (s[0] == '-')
    reverse(s.begin() + 1, s.end());
  else
    reverse(s.begin(), s.end());
  if (s == "") s += '0';
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  priority_queue<int, vector<int>, greater<int> > pq;
  int n;
  cin >> n;
  string s, t, c;
  int x;
  vector<string> ans;
  while (n--) {
    cin >> s;
    if (s != "removeMin") {
      cin >> x;
      if (s == "insert") {
        pq.push(x);
        t = "insert ", c = itoa(x), t += c;
        ans.push_back(t);
      } else {
        while (!pq.empty() && pq.top() < x) {
          t = "removeMin";
          ans.push_back(t);
          pq.pop();
        }
        if (pq.empty() || pq.top() > x)
          t = "insert ", c = itoa(x), t += c, ans.push_back(t), pq.push(x);
        t = "getMin ", c = itoa(x), t += c;
        ans.push_back(t);
      }
    } else {
      if (pq.empty()) t = "insert 0", ans.push_back(t), pq.push(0);
      t = "removeMin", ans.push_back(t), pq.pop();
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << "\n";
}
