#include <bits/stdc++.h>
using namespace std;
class myMinHeap {
 public:
  myMinHeap() { n = 0; }
  void push(int);
  int top() {
    assert(n >= 1);
    return a[1];
  }
  void pop();
  bool empty() { return (n == 0); }

 private:
  int a[100005];
  int n;
};
void myMinHeap::push(int val) {
  n++;
  a[n] = val;
  int temp = n, parent;
  while (temp > 1) {
    parent = temp / 2;
    if (a[parent] > a[temp]) swap(a[parent], a[temp]);
    temp >>= 1;
  }
}
void myMinHeap::pop() {
  assert(n >= 1);
  swap(a[1], a[n]);
  n--;
  int child1, child2, m;
  int temp = 1;
  bool done = false;
  while (temp <= n && !done) {
    done = true;
    child1 = 2 * temp;
    child2 = 2 * temp + 1;
    if (child1 <= n && child2 <= n) {
      m = min(a[child1], a[child2]);
      if (a[temp] > m) {
        if (m != a[child1]) swap(child1, child2);
        swap(a[temp], a[child1]);
        temp = child1;
        done = false;
      }
    } else if (child1 <= n) {
      if (a[temp] > a[child1]) {
        swap(a[temp], a[child1]);
        temp = child1;
        done = false;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, d;
  myMinHeap q;
  vector<string> ans;
  cin >> n;
  string op;
  for (int i = 0; i < n; i++) {
    cin >> op;
    if ((op == "insert")) {
      cin >> d;
      q.push(d);
      ans.push_back("insert " + to_string(d));
    } else if ((op == "getMin")) {
      cin >> d;
      while (!q.empty() && q.top() < d) {
        q.pop();
        ans.push_back("removeMin");
      }
      if (!q.empty() && q.top() == d)
        ;
      else {
        q.push(d);
        ans.push_back("insert " + to_string(d));
      }
      ans.push_back("getMin " + to_string(d));
    } else {
      if (q.empty())
        ans.push_back("insert 0");
      else
        q.pop();
      ans.push_back("removeMin");
    }
  }
  cout << ans.size() << "\n";
  for (int cnt = 0; cnt < ans.size(); cnt++) cout << ans[cnt] << "\n";
  return 0;
}
