#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define pi pair<int,int>
#define pii pair< pi >
string to_str(int n) {
        stringstream ss;
        ss << n;
        string str = ss.str();
        return str;
}

multiset<int> s;
vector<string> ans;
string op, temp;
int no,n;
string g[3] = {"insert ", "removeMin ", "getMin "};
int main() {
        ans.clear();
        s.clear();
        ios_base::sync_with_stdio(false);
        cin >> n;
        for(int i=0;i<n;i++) {
                cin >> op;
                if(op[0]!='r')
                        cin >> no;
                if(op[0]=='i') {
                        s.insert(no);
                        ans.pb(g[0] + to_str(no));
                }
                else if(op[0]=='r') {
                        if(s.empty()) {
								   ans.pb(g[0]+ "1");
                                s.insert(1);
                                //temp = g[1];
                                //ans.pb(temp);
                        }

                                s.erase(s.begin());
                                ans.pb(g[1]);

                }
                else {


                                        while(!s.empty() && *(s.begin())<no) {
                                                s.erase(s.begin());
                                                ans.pb(g[1]);
                                        }
                                        if(s.empty() || *(s.begin())!=no) {
                                                s.insert(no);
                                                ans.pb(g[0] + to_str(no));
                                                //temp = g[2] + to_str(no);
                                                //ans.pb(temp);
                                        }
                                                ans.pb(g[2] + to_str(no));

                        }


        }
        cout << ans.size() << endl;
        for(int i=0;i<ans.size();i++) {
                cout << ans[i] << endl;
        }
        return 0;

}