#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  std::cin >> n;
  std::vector<std::pair<std::string, int>> seq;
  std::priority_queue<int, std::vector<int>, std::greater<int>> q;
  for (int i = 0; i < n; ++i) {
    std::string op;
    std::cin >> op;
    if (op == "insert") {
      int x;
      std::cin >> x;
      q.push(x);
      seq.push_back(std::make_pair(op, x));
    } else if (op == "getMin") {
      int x;
      std::cin >> x;
      while (!q.empty() && q.top() < x) {
        q.pop();
        seq.push_back(std::make_pair("removeMin", 0));
      }
      if (q.empty() || q.top() != x) {
        q.push(x);
        seq.push_back(std::make_pair("insert", x));
      }
      seq.push_back(std::make_pair(op, x));
    } else {
      if (q.empty()) {
        seq.push_back(std::make_pair("insert", 1337));
        seq.push_back(std::make_pair(op, 0));
      } else {
        q.pop();
        seq.push_back(std::make_pair(op, 0));
      }
    }
  }
  std::cout << seq.size() << '\n';
  for (auto&& o : seq) {
    if (o.first != "removeMin") {
      std::cout << o.first << ' ' << o.second << '\n';
    } else {
      std::cout << o.first << '\n';
    }
  }
  return 0;
}
