#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32000000")
using namespace std;
#pragma comment(linker, "/STACK:56777216")
void Out(const vector<int>& v) {
  for (auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}
std::vector<std::string>& split(const std::string& s, char delim,
                                std::vector<std::string>& elems) {
  std::stringstream ss(s);
  std::string item;
  while (std::getline(ss, item, delim)) {
    elems.push_back(item);
  }
  return elems;
}
std::vector<std::string> split(const std::string& s, char delim) {
  std::vector<std::string> elems;
  split(s, delim, elems);
  return elems;
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
const int inser = 0;
const int remov = 1;
const int getmin = 2;
const string Rem = "removeMin";
const string Ins = "insert";
const string Get = "getMin";
void Output(const vector<int>& com, const vector<int>& n) {
  cout << com.size() << endl;
  for (int i = 0; i < com.size(); ++i) {
    if (com[i] == remov) {
      printf(Rem.c_str());
      printf("\n");
    } else if (com[i] == inser) {
      printf(Ins.c_str());
      printf(" ");
      printf("%d\n", n[i]);
    } else {
      printf(Get.c_str());
      printf(" %d\n", n[i]);
    }
  }
}
void GetAns(const vector<int>& command, const vector<int>& num,
            vector<int>& ansCom, vector<int>& ansN) {
  multiset<int> ms;
  for (int i = 0; i < command.size(); ++i) {
    if (command[i] == inser) {
      ansCom.push_back(inser);
      ansN.push_back(num[i]);
      ms.insert(num[i]);
    } else if (command[i] == remov) {
      if (ms.empty()) {
        ansCom.push_back(inser);
        ansN.push_back(1);
      } else {
        ms.erase(ms.begin());
      }
      ansCom.push_back(remov);
      ansN.push_back(1);
    } else {
      assert(command[i] == getmin);
      while (!ms.empty() && *ms.begin() < num[i]) {
        ansCom.push_back(remov);
        ansN.push_back(1);
        ms.erase(ms.begin());
      }
      if (ms.empty() || *ms.begin() > num[i]) {
        ansCom.push_back(inser);
        ansN.push_back(num[i]);
        ms.insert(num[i]);
      }
      ansCom.push_back(getmin);
      ansN.push_back(num[i]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  clock_t begin = clock();
  int n;
  cin >> n;
  string s;
  getline(cin, s);
  vector<int> command(n);
  vector<int> num(n);
  for (int i = 0; i < n; ++i) {
    getline(cin, s);
    stringstream ss(s);
    string op;
    ss >> op;
    if (op == Ins) {
      command[i] == inser;
      ss >> num[i];
    } else if (op == Get) {
      command[i] = getmin;
      ss >> num[i];
    } else {
      assert(op == Rem);
      command[i] = remov;
    }
  }
  vector<int> ansCom;
  vector<int> ansN;
  GetAns(command, num, ansCom, ansN);
  Output(ansCom, ansN);
  clock_t end = clock();
  return 0;
}
