#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int maxn = 3e6 + 10;
int n, a[maxn], b[maxn], cnt;
char str[3][12] = {"insert", "removeMin", "getMin"};
priority_queue<int, vector<int>, greater<int> > q;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    char x[10];
    int y;
    scanf("%s", x);
    if (x[0] == 'g') {
      scanf("%d", &y);
      int u;
      if (!q.empty()) u = q.top();
      while (!q.empty() && u < y) {
        q.pop();
        a[++cnt] = 1;
        if (!q.empty())
          u = q.top();
        else
          break;
      }
      if (q.empty() || u > y) a[++cnt] = 0, b[cnt] = y, q.push(y);
      a[++cnt] = 2, b[cnt] = y;
    } else if (x[0] == 'i') {
      scanf("%d", &y);
      q.push(y);
      a[++cnt] = 0, b[cnt] = y;
    } else {
      if (q.empty()) a[++cnt] = 0, b[cnt] = 1, q.push(1);
      q.pop();
      a[++cnt] = 1;
    }
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    if (a[i] == 1)
      printf("%s\n", str[a[i]]);
    else
      printf("%s %d\n", str[a[i]], b[i]);
  }
  return 0;
}
