#include<bits/stdc++.h>
#define TP int
#define Max 109
using namespace std;
inline TP read(){
    char c=getchar();
    TP x=0;
    bool f=0;
    while(!isdigit(c))f^=!(c^45),c=getchar();
    while(isdigit(c))x=(x<<1)+(x<<3)+(c^48),c=getchar();
    if(f)x=-x;return x;
}
int n,a[Max],b[Max];
int main(){
    n=read();
    for(int i=1;i<=n;++i){
    	a[i]=read();
		b[i]=(b[i-1]^a[i]);
    }
    int ans=0;
    for(int i=1;i<=n;++i){
        for(int j=i;j<=n;++j){
            ans=max(ans,b[j]^b[i-1]);
        }
    }
    printf("%d\n",ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
   int n; cin>>n;
   vector <ll> v(n);
   for (int i = 0 ; i < n; i++) cin>>v[i];

   if (n == 1){
    cout << v[0] << endl;
    return 0;
   }
   ll ans = 0;
   for (int i = 0; i < n-1 ;i++){
        ll curr = v[i];
    for (int k = i; k < n ; k++){
        curr = curr^v[k];
        ans = max(ans,curr);
    }
   }
   cout << ans << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
   int n; cin>>n;
   vector <ll> v(n);
   for (int i = 0 ; i < n; i++) cin>>v[i];

   if (n == 1){
    cout << v[0] << endl;
    return 0;
   }
   ll ans = 0;
   for (int i = 0; i < n ;i++){
        ll curr = 0;
    for (int k = i; k < n ; k++){
        curr = curr^v[k];
        ans = max(ans,curr);
    }
   }
   cout << ans << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
   int n; cin>>n;
   vector <ll> v(n);
   for (int i = 0 ; i < n; i++) cin>>v[i];

   ll ans = 0;
   for (int i = 0; i < n-1 ;i++){
        ll curr = v[i];
    for (int k = i; k < n ; k++){
        curr = curr^v[k];
        ans = max(ans,curr);
    }
   }
   cout << ans << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
   int n; cin>>n;
   vector <ll> v(n);
   for (int i = 0 ; i < n; i++) cin>>v[i];

   if (n == 1){
    cout << v[0] << endl;
    return 0;
   }
   ll ans = 0;
   for (int i = 0; i < n-1 ;i++){
        ll curr = 0;
    for (int k = i; k < n ; k++){
        curr = curr^v[k];
        ans = max(ans,curr);
    }
   }
   cout << ans << endl;

    return 0;
}


#define ll long long

#include "bits/stdc++.h"

using namespace std;
const int N = 1e6;
map<ll,ll>mp;
int arr[N];

int main() {

ll n;
cin>>n;
int index=0,maxi=0;
for(int i=0;i<n;i++){cin>>arr[i];}

for(int i=0;i<n;i++)
{
    int x=0;
    for(int j=i;j<n;j++)
    {
        x=x^arr[j];
        maxi=max(maxi,x);
    }
    //cout<<x<<endl;

}
cout<<maxi;

    return 0;
}


#define ll long long

#include "bits/stdc++.h"

using namespace std;
const int N = 1e6;
map<ll,ll>mp;
int arr[N];

int main() {

ll n;
cin>>n;
int index=0,maxi=0;
for(int i=0;i<n;i++){cin>>arr[i];maxi=max(maxi,arr[i]);}

for(int i=0;i<n;i++)
{
    int x=arr[i];
    for(int j=i+1;j<n;j++)
    {
        x=(x^arr[j]);
    }
    if(x >= maxi)
    {
        maxi=x;
    }

}
cout<<maxi<<endl;

    return 0;
}


//COUNTING PATHS IN DAG DP
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <cstring>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include<random>
#include <chrono>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#endif
#define __ ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
// #define INF 0x7f7f7f7f
#define ull unsigned long long int
#define pii pair<int,int>
#define ll long long
// #define ld long double
// #define l long
#define se second
#define fi first
#define UNVISITED -1
#define EXPOLORED 0
#define mk make_pair
#define pb push_back
#define sc(n) scanf("%d",&n)
#define pii pair<int,int>
#define eps 1e-8
#define sz(a) a.size()
#define all(x) x.begin(),x.end()
#define me(u,v,w) make_pair(w,make_pair(u,v))
#define inrange(x,y,row,col) (x>=0 && y>=0 && x<row && y<col)
#define foreach(e, x) for(__typeof(x.begin()) e = x.begin(); e != x.end(); ++ e)
#define add(a,b) (a + b >= MOD ? a+b-MOD:a+b)
#define hs(c1,c2) (256*min(c1,c2) + max(c1,c2))
#define rep(i,a,b) for(int i=a;i<b;++i)
// template<typename T>T gcd(T x,T y){if(y==0)return x;return gcd(y,x%y);}
// typedef long double ld;
// typedef complex<ld> cd;

// typedef pair<ll, ll> pi;
// typedef pair<ll,ll> pl;
// typedef pair<ld,ld> pd;

// typedef vector<ll> vi;
// typedef vector<ld> vd;
// typedef vector<ll> vl;
// typedef vector<pi> vpi;
// typedef vector<pl> vpl;
// typedef vector<cd> vcd;
const int N = 110;
int a[N];
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i)cin>>a[i];
    int ans = 0,tans = 0;
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            tans = 0;
            for(int k=i;k<=j;++k){
                tans ^= a[k];
            }
            ans = max(ans,tans);
        }
    }
    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
// #define INF 0x7f7f7f7f
#define ull unsigned long long int
#define pii pair<int,int>
#define ll long long
// #define ld long double
// #define l long
#define se second
#define fi first
#define UNVISITED -1
#define EXPOLORED 0
#define mk make_pair
#define pb push_back
#define sc(n) scanf("%d",&n)
#define pii pair<int,int>
#define eps 1e-8
#define sz(a) a.size()
#define all(x) x.begin(),x.end()
#define me(u,v,w) make_pair(w,make_pair(u,v))
#define inrange(x,y,row,col) (x>=0 && y>=0 && x<row && y<col)
#define foreach(e, x) for(__typeof(x.begin()) e = x.begin(); e != x.end(); ++ e)
#define add(a,b) (a + b >= MOD ? a+b-MOD:a+b)
#define hs(c1,c2) (256*min(c1,c2) + max(c1,c2))
#define rep(i,a,b) for(int i=a;i<b;++i)
const int N = 110;
int a[N];
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i)cin>>a[i];
    int ans = 0,tans = 0;
    for(int i=0;i<n;++i){
        for(int j=0;j<i;++j){
            tans = 0;
            for(int k=i;k<j;++k){
                tans ^= a[k];
            }
            ans = max(ans,tans);
        }
    }
    cout<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int n,arr[105],res[105],xam;
int main(){
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
        res[i] = arr[i];
        if(i>0)res[i] ^= res[i-1];
    }
    xam = res[0];
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            xam = max(xam,res[i]^res[j]);
        }
    }
    printf("%d\n", xam);
}


#include <bits/stdc++.h>
using namespace std;
int n,arr[105],res[105],xam;
int main(){
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
        res[i] = arr[i];
        if(i>0)res[i] ^= res[i-1];
    }
    //xam = res[0];
    for(int i = 0; i < n; i++){
        xam = max(xam,res[i]);
        for(int j = i+1; j < n; j++){
            xam = max(xam,res[i]^res[j]);
        }
    }
    printf("%d\n", xam);
}


#include <bits/stdc++.h>
using namespace std;
int n,arr[105],res[105],xam;
int main(){
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
        res[i] = arr[i];
        if(i>0)res[i] ^= res[i-1];
    }
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            xam = max(xam,res[i]^res[j]);
        }
    }
    printf("%d\n", xam);
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        an=0;
        for(int j=i;j<n;j++)
        {
            if(an<(an^a[i]))
                an^=a[i];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                      H.Pouya ؟(◠?◠)?
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=n-1;0<=i;i--)
    {
        if(ans<(ans^a[i]))
            ans^=a[i];
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<n;i++)
    {
        an=0;
        for(int j=i;j<n;j++)
        {
            an^=a[j];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        an=0;
        for(int j=i;j<n;j++)
        {
            an^=a[j];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        for(int j=i;j<n;j++)
        {
            if(an<(an^a[i]))
                an^=a[i];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=n-1;0<=i;i--)
    {
        for(int j=n-1;0<=j;j--)
        {
            if(an<(an^a[i]))
                an^=a[i];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        for(int j=i;j<n;j++)
        {
            an^=a[j];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
const int maxn=105;
int n,an,ans,a[maxn];
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=n-1;0<=i;i--)
    {
        for(int j=i;0<=j;j--)
        {
            if(an<(an^a[i]))
                an^=a[i];
            ans=max(ans,an);
        }
    }
    cout<<ans;
    return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

int n,a[200],b[200];

inline int Max(const int &x,const int &y) {return x>y?x:y;}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",a[i]),b[i]=b[i-1]^a[i];
    int ans=0;
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++)
        ans=Max(ans,b[j]^b[i-1]);
    printf("%d\n",ans);
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

int n,a[200],b[200];

inline int Max(const int &x,const int &y) {return x>y?x:y;}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]),b[i]=b[i-1]^a[i];
    int ans=0;
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++)
        ans=Max(ans,b[j]^b[i-1]);
    printf("%d\n",ans);
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = -1;
  for (int i = 0; i < n; ++i) {
    int64_t e;
    for (int j = i; j < n; j++) {
      e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        e = e ^ x[k];
      }
    }

    ma = max<int64_t>(ma, e);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = -1;
  for (int i = 0; i < n; ++i) {
    int64_t exclusiveor = x[i];
    for (int j = i+1; j < n; j++) {
      for (int k = i; k <= j ; ++k) {
        exclusiveor = exclusiveor ^ x[k];
      }
    }
    ma = max<int64_t>(ma, exclusiveor);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = -1;
  for (int i = 0; i < n; ++i) {
    int64_t e;

    for (int j = i+1; j < n; j++) {
      e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        e= e^ x[k];
      }
    }

    ma = max<int64_t>(ma, e);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = -1;
  for (int i = 0; i < n; ++i) {
    int64_t exclusiveor = x[i];
    for (int j = i; j < n; j++) {
      for (int k = i+1; k <= j ; ++k) {
        exclusiveor = exclusiveor ^ x[k];
      }
    }
    ma = max<int64_t>(ma, exclusiveor);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = 0;

  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; j++) {
      int64_t e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        if (j==i) break;
        e ^=  x[k];
      }
      ma = max<int64_t>(ma, e);
    }
  }

  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  int64_t ma = -1;
  for (int i = 0; i < n; ++i) {
    int64_t exclusiveor = x[i];
    for (int j = i; j < n; j++) {
      exclusiveor = exclusiveor ^ x[j];
    }
    ma = max<int64_t>(ma, exclusiveor);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = 0;
  for (int i = 0; i < n; ++i) {
    int64_t e;
    for (int j = i+1; j < n; j++) {
      e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        e = e ^ x[k];
      }
    }
    ma = max<int64_t>(ma, e);
  }

  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = 0;
  for (int i = 0; i < n; ++i) {
    int64_t e;
    for (int j = i+1; j < n; j++) {
      e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        e = e ^ x[k];
      }
    }
    ma = max<int64_t>(max<int64_t>(ma, x[i]), e);
  }

  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;

  int64_t x[100];

  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }

  int64_t ma = 0;
  for (int i = 0; i < n; ++i) {
    int64_t e;
    for (int j = i; j < n; j++) {
      e = x[i];
      for (int k = i+1; k <= j ; ++k) {
        e = e ^ x[k];
      }
    }

    ma = max<int64_t>(ma, e);
  }
  std::cout << ma << std::endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL_CHECK
#define trace(x) cerr << #x << ": " << x << " ";
#define trnl cerr << "\n";
#else
#define trace(x) {}
#define trnl {}
#endif
typedef long long lolo;
typedef unsigned long long ulolo;
typedef pair<int, int> pii;
#define F(i,a,b) for(int i=(a);i<(b);++i)
#define R(i,n) F(i,0,n)
#define FD(i,n) for(int i=(n-1);i>=0;--i)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define fi first
#define se second
#define M_PI           3.14159265358979323846

const int INF = 1e9 + 23;
const int MOD = 1e9 + 7;
const int N = 100 + 10;

int a[N];

int main()
{
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int ans = 0;
  R(i, n) {
    cin >> a[i];
  }
  R(i, n) {
    int cur = 0;
    F(j, i, n) {
      cur ^= a[j];
      if (cur > ans) ans = cur;
    }
  }
  cout << ans << "\n";
}
// g++ -W -Wall -Wextra -pedantic -std=c++0x -o p main.cpp


#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL_CHECK
#define trace(x) cerr << #x << ": " << x << " ";
#define trnl cerr << "\n";
#else
#define trace(x) {}
#define trnl {}
#endif
typedef long long lolo;
typedef unsigned long long ulolo;
typedef pair<int, int> pii;
#define F(i,a,b) for(int i=(a);i<(b);++i)
#define R(i,n) F(i,0,n)
#define FD(i,n) for(int i=(n-1);i>=0;--i)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define fi first
#define se second
#define M_PI           3.14159265358979323846

const int INF = 1e9 + 23;
const int MOD = 1e9 + 7;
const int N = 100 + 10;

int a[N];

int main()
{
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int ans = 0;
  R(i, n) {
    cin >> a[i];
    int cur = 0;
    R(j, i+1) {
      cur ^= a[j];
      if (cur > ans) ans = cur;
    }
  }
  cout << ans << "\n";
}
// g++ -W -Wall -Wextra -pedantic -std=c++0x -o p main.cpp


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,a[105],n;
    int x,mx=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) {
        scanf("%d",&a[i]);
        mx=max(mx,a[i]);
    }
    for(i=0;i<n;i++){
        x=a[i];
        for(j=i;j<n;j++){
            x=x^a[j];
            mx=max(x,mx);
        }
    }
    cout<<mx;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,a[105],n;
    long long int x,mx=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        x=a[i];
        for(j=i;j<n;j++){
            x=x^a[j];
            mx=max(x,mx);
        }
    }
    cout<<mx;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,a[105],n;
    int x,mx=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) {
        scanf("%d",&a[i]);
        mx=max(mx,a[i]);
    }
    for(i=0;i<n-1;i++){
        x=a[i];
        for(j=i+1;j<n;j++){
            x=x^a[j];
            mx=max(x,mx);
        }
    }
    cout<<mx;
}


#include <iostream>
using namespace std;

int main()
{
	int n; cin >> n;
	int a[n]; for(int I=0;I<n;I+=1) cin >> a[I];
	int maxxor = 0;
	for(int I=0;I<n;I+=1)
	{
		int j = n;
		int xorr = a[j];
		if(xorr > maxxor)
				maxxor = xorr;
		for(int T=I+1;T<n;T+=1)
		{
			xorr= xorr^a[T];
			if(xorr > maxxor)
				maxxor = xorr;
		}
	}
	cout << maxxor;
}


#include <iostream>
using namespace std;

int main()
{
	int n; cin >> n;
	int a[n]; for(int I=0;I<n;I+=1) cin >> a[I];
	int maxxor = 0;
	for(int I=0;I<n;I+=1)
	{
		int xorr = a[I];
		if(xorr > maxxor)
				maxxor = xorr;
		for(int T=I+1;T<n;T+=1)
		{
			xorr= xorr^a[T];
			if(xorr > maxxor)
				maxxor = xorr;
		}
	}
	cout << maxxor;
}


#include<iostream>
using namespace std;
int n, a[100], res;
int main()
{
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < n; i++)
	{
		int t = 0;
		for(int j = i; j < n; j++)
		{
			t ^= a[j];
			res = max(t, res);
		}
	}
	cout << res;
	return 0;
}


#include<iostream>
using namespace std;
int n, a[100], res;
int main()
{
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < n; i++)
	{
		int t = 0;
		for(int j = 0; j < n; j++)
		{
			t ^= a[j];
			res = max(t, res);
		}
	}
	cout << res;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
    int n,a[110],maxs=-1,temp=1;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
        maxs=a[0];
        for(int i=0;i<n;i++)
        {
            int z=0,temp=a[i];
            for(int j=i+1;j<n;j++)
            {
                temp^=a[j];
                if(temp>maxs)
                maxs=temp;
            }
        }
    cout<<maxs<<endl;
    return 0;
}


#include <iostream>
using namespace std;

int main() {
    int n,a[110],maxs=-1,temp=1;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
        maxs=a[0];
        for(int i=0;i<n;i++)
        {
            temp=0;
            for(int j=i;j<n;j++)
            {
                temp^=a[j];
                if(temp>maxs)
                maxs=temp;
            }
        }
    cout<<maxs<<endl;
    return 0;
}


#include <iostream>
using namespace std;

int main() {
    int n,a[110],maxs=-1,temp=1;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
        for(int i=0;i<n;i++)
        {
            int z=0,temp=a[i];
            for(int j=i;j<n;j++)
            {
                temp^=a[j];
                if(temp>maxs)
                maxs=temp;
            }
        }
    cout<<maxs<<endl;
    return 0;
}


#include <iostream>
using namespace std;

int main() {
    int n,a[110],maxs=-1,temp=1;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
        for(int i=0;i<n;i++)
        {
            int z=0,temp=a[i];maxs=temp;
            for(int j=i;j<n;j++)
            {
                temp^=a[j];
                if(temp>maxs)
                maxs=temp;
            }
        }
    cout<<maxs<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
long long a[100];
for(int i=0;i<n;i++)cin>>a[i];
long long ans=0,xo;
for(int i=0;i<n;i++){xo=a[i];
    if(xo>ans){ans=xo;}
    for(int j=i+1;j<n;j++){

        if(xo>ans){ans=xo;}
        xo^=a[j];
    }
}

cout<<ans;
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int test=sc.nextInt();
      sc.nextLine();
      PriorityQueue<Integer> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.nextLine();
          String arr[]=in.split(" ");

          int x;
          if(arr[0].equals("insert")){
              x=Integer.parseInt(arr[1]);
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(arr[0].equals("getMin")){
              x=Integer.parseInt(arr[1]);
                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    int g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(arr[0].equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";
                    pq.add(0);
                }
                    int g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
      }
       System.out.println(cnt);
       System.out.println(res);

    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int test=sc.nextInt();
      sc.nextLine();
      PriorityQueue<Integer> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.nextLine();
          String arr[]=in.split(" ");

          if(arr[0].equals("insert")){
              pq.add(Integer.parseInt(arr[1]));
              res=res+"insert "+arr[1]+"\n";cnt++;
          }
          else if(arr[0].equals("removeMin")){
              int min=Integer.MAX_VALUE;
               for(Integer i:pq){
                        if(i<min){
                            min=i;
                        }
                    }
                    pq.remove(min);
                    res=res+ "removeMin"+"\n";cnt++;
          }

          else if(arr[0].equals("getMin")){

                if(pq.contains(arr[1]) && !pq.isEmpty()){
                    res=res+"getMin " +arr[1]+"\n";cnt++;
                }
                else{
                            pq=new PriorityQueue<>();
                            res=res+ "removeMin"+"\n";cnt++;

                        pq.add(Integer.parseInt(arr[1]));
                        res=res+"insert "+arr[1]+"\n";cnt++;
                        res=res+"getMin " +arr[1]+"\n";cnt++;
                     }

                }
      }
       System.out.println(cnt);
       System.out.println(res+"\n");

    }
}


import java.util.*;
import java.io.*;
public class MyClass {
    public static void main(String args[]) throws IOException{
      //Scanner sc=new Scanner(System.in);
      BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
      long test=Integer.parseInt(br.readLine());
      //sc.nextLine();
      PriorityQueue<Long> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String inp=br.readLine();
          String inp_arr[]=inp.split(" ");
          String in=inp_arr[0];
          long x;
          if(in.equals("insert")){
              x=Long.parseLong(inp_arr[1]);
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(in.equals("getMin")){
               x=Long.parseLong(inp_arr[1]);
                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    long g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(in.equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";cnt++;
                    pq.add((long)0);
                }
                    long g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
      }
       System.out.println(cnt);
       System.out.println(res);

    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int test=sc.nextInt();
      sc.nextLine();
      PriorityQueue<Integer> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.nextLine();
          String arr[]=in.split(" ");

          if(arr[0].equals("insert")){
              pq.add(Integer.parseInt(arr[1]));
              res=res+"insert "+arr[1]+"\n";cnt++;
          }
          else if(arr[0].equals("removeMin")){
              int min=Integer.MAX_VALUE;
               for(Integer i:pq){
                        if(i<min){
                            min=i;
                        }
                    }
                    pq.remove(min);
                    res=res+ "removeMin"+"\n";cnt++;
          }

          else if(arr[0].equals("getMin")){

                if(pq.contains(arr[1]) && !pq.isEmpty()){
                    res=res+"getMin " +arr[1]+"\n";cnt++;
                }
                else{
                        res=res+ "removeMin"+"\n";cnt++;
                        pq=new PriorityQueue<>();
                        //res=res+ "removeMin"+"\n";cnt++;
                        pq.add(Integer.parseInt(arr[1]));
                        res=res+"insert "+arr[1]+"\n";cnt++;
                        res=res+"getMin " +arr[1]+"\n";cnt++;
                     }

                }
      }
       System.out.println(cnt);
       System.out.println(res+"\n");

    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      long test=sc.nextLong();
      sc.nextLine();
      PriorityQueue<Long> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.next();
          long x;
          if(in.equals("insert")){
              x=sc.nextLong();
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(in.equals("getMin")){
              x=sc.nextLong();
                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    long g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(in.equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";cnt++;
                    pq.add((long)0);
                }
                    long g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
      }
       System.out.println(cnt);
       System.out.println(res);

    }
}


import java.util.*;
import java.io.*;
public class MyClass {
    public static void main(String args[]) throws IOException{
      //Scanner sc=new Scanner(System.in);
      BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
      long test=Long.parseLong(br.readLine());
      //sc.nextLine();
      PriorityQueue<Long> pq=new PriorityQueue<>();int cnt=0;
      ArrayList<String> list=new ArrayList<>();
      String res="";
      while(test-->0){
          String inp=br.readLine();
          String inp_arr[]=inp.split(" ");
          String in=inp_arr[0];
          long x;
          if(in.equals("insert")){
              x=Long.parseLong(inp_arr[1]);
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(in.equals("getMin")){
               x=Long.parseLong(inp_arr[1]);
                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    long g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(in.equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";cnt++;
                    pq.add((long)0);
                }
                    long g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
          list.add(res);
          res="";
      }
       System.out.println(cnt);
       for(String i:list){
           System.out.print(i);
       }

    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int test=sc.nextInt();
      sc.nextLine();
      PriorityQueue<Integer> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.nextLine();
          String arr[]=in.split(" ");

          int x;
          if(arr[0].equals("insert")){
              x=Integer.parseInt(arr[1]);
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(arr[0].equals("getMin")){
              x=Integer.parseInt(arr[1]);
                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    int g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(arr[0].equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";cnt++;
                    pq.add(0);
                }
                    int g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
      }
       System.out.println(cnt);
       System.out.println(res);

    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int test=sc.nextInt();
      sc.nextLine();
      PriorityQueue<Integer> pq=new PriorityQueue<>();int cnt=0;
      String res="";
      while(test-->0){
          String in=sc.nextLine();
          String arr[]=in.split(" ");
          int x=Integer.parseInt(arr[1]);
          if(arr[0].equals("insert")){
              pq.add(x);
              res=res+"insert "+x+"\n";cnt++;
          }

          if(arr[0].equals("getMin")){

                while(!pq.isEmpty() && pq.peek()<x) {
                    res=res+ "removeMin"+"\n";cnt++;
                    int g=pq.peek();
                    pq.remove(g);
                }
                if(pq.isEmpty() || pq.peek()>x){
                        pq.add(x);
                        res=res+"insert "+x+"\n";cnt++;
                     }
                    res=res+"getMin " +x+"\n";cnt++;
                }

          if(arr[0].equals("removeMin")){
                if(pq.isEmpty()){
                    res=res+"insert 0 \n";
                    pq.add(x);
                }
                    int g=pq.peek();
                    pq.remove(g);
                    res=res+ "removeMin"+"\n";cnt++;
          }
      }
       System.out.println(cnt);
       System.out.println(res);

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastReader fr = new FastReader();
		StringBuilder sb = new StringBuilder();
		String record = new String();
		int n = fr.nextInt();
		int opTotal = 0;
		Heap h = new Heap(n);

		while (n-- > 0) {
			record = fr.next();
			if (record.equals("insert")) {
				int num = fr.nextInt();
				//System.out.println(num);
				h.insert(num);
				sb.append(record + " " + num + "\n");
				opTotal++;
			}
			else if (record.equals("getMin"))
			{
				int num = fr.nextInt();
				boolean achou = false;
				while (h.curr_size > 0 && !achou)
				{
					int top = h.top();
					if (top == num) achou = true;
					else if (top > num) break;
					else {
						h.remove();
						sb.append("removeMin\n");
						opTotal++;
					}
				}
				if (achou == false) {
					h.insert(num);
					sb.append("insert " + num + "\n");
					opTotal++;
				}
				sb.append(record + " " + num + "\n");
				opTotal++;
			}
			else if (record.equals("removeMin"))
			{
				if (h.curr_size > 0) {
					h.remove();
					sb.append(record + "\n");
					opTotal++;
				}
				else {
					sb.append("insert 0\n" + record + "\n");
					opTotal += 2;
				}
			}
		}
		System.out.println(opTotal);
		System.out.print(sb);
	}

	static class Heap
	{
		ArrayList<Integer> heap;
		int curr_size;

		public Heap (int n)
		{
			heap = new ArrayList<Integer>();
			heap.add(0);
			curr_size = 0;
		}

		public int top ()
		{
			if (heap.size() > 1) return heap.get(1);
			else return 0;
		}

		public void insert (int k)
		{
			heap.add(k);
			curr_size++;
			heapifyIn();
			//for (int i = 0 ; i <= curr_size ; i++) System.out.print(heap.get(i) + " ");
		}

		public int remove()
		{
			int aux = heap.get(1);
			heap.set(1, heap.get(curr_size));
			heap.remove(curr_size);
			curr_size--;
			if (curr_size > 0) heapifyRmv();
			//for (int i = 0 ; i <= curr_size ; i++) System.out.print(heap.get(i) + " ");
			return aux;
		}

		public void heapifyIn ()
		{
			int k = curr_size;
			boolean isHeap = false;
			while (!isHeap && k/2 >= 1)
			{
				int j = k/2;
				if (heap.get(j) <= heap.get(k)) isHeap = true;
				else {
					int aux = heap.get(j);
					heap.set(j, heap.get(k));
					heap.set(k, aux);
					k = j;
				}
			}
		}

		public void heapifyRmv()
		{
			int k = 1;
			int v = heap.get(k);
			boolean isHeap = false;

			while(!isHeap && 2 * k <= curr_size){
				int j = k * 2;
				if (j <= curr_size - 1){
					if (heap.get(j) > heap.get(j + 1)) j++;
				}
				if (v <= heap.get(j)) isHeap = true;
				else {
					heap.set(k, heap.get(j));
					k = j;
				}
			}
			heap.set(k, v);
		}
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastReader fr = new FastReader();
		StringBuilder sb = new StringBuilder();
		String record = new String();
		int n = fr.nextInt();
		int opTotal = 0;
		Heap h = new Heap(n);

		while (n-- > 0) {
			record = fr.next();
			if (record.equals("insert")) {
				int num = fr.nextInt();
				//System.out.println(num);
				h.insert(num);
				sb.append(record + " " + num + "\n");
				opTotal++;
			}
			else if (record.equals("getMin"))
			{
				int num = fr.nextInt();
				boolean achou = false;
				while (h.curr_size > 0 && !achou)
				{
					int top = h.top();
					if (top == num) achou = true;
					else if (top > num) break;
					else {
						h.remove();
						sb.append("removeMin\n");
						opTotal++;
					}
				}
				if (achou == false) {
					h.insert(num);
					sb.append("insert " + num + "\n");
					opTotal++;
				}
				sb.append(record + " " + num + "\n");
				opTotal++;
			}
			else if (record.equals("removeMin"))
			{
				if (h.curr_size > 0) {
					h.remove();
					sb.append(record + "\n");
					opTotal++;
				}
				else {
					sb.append("insert 10\n" + record + "\n");
					opTotal += 2;
				}
			}
		}
		System.out.println(opTotal);
		System.out.print(sb);
	}

	static class Heap
	{
		ArrayList<Integer> heap;
		int curr_size;

		public Heap (int n)
		{
			heap = new ArrayList<Integer>();
			heap.add(0);
			curr_size = 0;
		}

		public int top ()
		{
			if (heap.size() > 1) return heap.get(1);
			else return 0;
		}

		public void insert (int k)
		{
			heap.add(k);
			curr_size++;
			heapifyIn();
			//for (int i = 0 ; i <= curr_size ; i++) System.out.print(heap.get(i) + " ");
		}

		public int remove()
		{
			int aux = heap.get(1);
			heap.set(1, heap.get(curr_size));
			heap.remove(curr_size);
			curr_size--;
			if (curr_size > 0) heapifyRmv();
			//for (int i = 0 ; i <= curr_size ; i++) System.out.print(heap.get(i) + " ");
			return aux;
		}

		public void heapifyIn ()
		{
			int k = curr_size;
			boolean isHeap = false;
			while (!isHeap && k/2 >= 1)
			{
				int j = k/2;
				if (heap.get(j) <= heap.get(k)) isHeap = true;
				else {
					int aux = heap.get(j);
					heap.set(j, heap.get(k));
					heap.set(k, aux);
					k = j;
				}
			}
		}

		public void heapifyRmv()
		{
			int k = 1;
			int v = heap.get(k);
			boolean isHeap = false;

			while(!isHeap && 2 * k <= curr_size){
				int j = k * 2;
				if (j <= curr_size - 1){
					if (heap.get(j) > heap.get(j + 1)) j++;
				}
				if (v <= heap.get(j)) isHeap = true;
				else {
					heap.set(k, heap.get(j));
					k = j;
				}
			}
			heap.set(k, v);
		}
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.security.cert.CollectionCertStoreParameters;
import java.util.*;
import java.util.function.Function;

public class Main {

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)) {
            int n = in.nextInt();

            ArrayList<String>ans= new ArrayList<>();
            PriorityQueue<Integer>temp= new PriorityQueue<>();

            for (int i = 0; i < n; i++) {
                String s=in.next();
                if (s.equals("removeMin")){
                    if(temp.isEmpty()){
                        ans.add("insert 1");
                        ans.add("removeMin");
                    }else {
                        ans.add("removeMin");
                        temp.poll();
                    }
                }else if (s.equals("insert")){
                    int x=in.nextInt();
                    ans.add("insert "+x);
                    temp.add(x);
                }else{
                    int x=in.nextInt();
                    if (temp.isEmpty()){
                        ans.add("insert "+x);
                        ans.add("getMin "+x);
                        temp.add(x);
                    }else{
                        if (temp.peek()==x){
                            ans.add("getMin "+x);
                        }else if (temp.peek()>x){
                            ans.add("insert "+x);
                            ans.add("getMin "+x);
                            temp.add(x);
                        }else{
                            while (!temp.isEmpty()&&temp.peek()<x){
                                ans.add("removeMin");
                                temp.poll();
                            }
                            if (temp.isEmpty()||temp.peek()!=x) {
                                temp.offer(x);
                                ans.add("insert " + x);
                                ans.add("getMin " + x);
                            }else {
                                ans.add("getMin " + x);
                            }
                        }
                    }
                }
            }
            or.println(ans.size());
            for (int i = 0; i < ans.size(); i++) {
                or.println(ans.get(i));
            }

        }
    }

    static int getlen(int r,int l,int a){
        return (r-l+1+1)/(a+1);
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class Pair  {
    int first, second;

    public Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }

}

class Tempo {

    int num;
    int index;

    public Tempo(int num, int index) {
        this.num = num;
        this.index = index;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.security.cert.CollectionCertStoreParameters;
import java.util.*;
import java.util.function.Function;

public class Main {

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)) {
            int n = in.nextInt();

            ArrayList<String>ans= new ArrayList<>();
            PriorityQueue<Integer>temp= new PriorityQueue<>();

            for (int i = 0; i < n; i++) {
                String s=in.next();
                if (s.equals("removeMin")){
                    if(temp.isEmpty()){
                        ans.add("insert 1");
                        ans.add("removeMin");
                    }else {
                        ans.add("removeMin");
                        temp.poll();
                    }
                }else if (s.equals("insert")){
                    int x=in.nextInt();
                    ans.add("insert "+x);
                    temp.add(x);
                }else{
                    int x=in.nextInt();
                    if (temp.isEmpty()){
                        ans.add("insert "+x);
                        ans.add("getMin "+x);
                        temp.add(x);
                    }else{
                        if (temp.peek()==x){
                            ans.add("getMin "+x);
                        }else if (temp.peek()>x){
                            ans.add("insert "+x);
                            ans.add("getMin "+x);
                            temp.add(x);
                        }else{
                            while (!temp.isEmpty()&&temp.peek()<x){
                                ans.add("removeMin");
                                temp.poll();
                            }
                            temp.offer(x);
                            ans.add("insert "+x);
                            ans.add("getMin "+x);
                        }
                    }
                }
            }
            or.println(ans.size());
            for (int i = 0; i < ans.size(); i++) {
                or.println(ans.get(i));
            }

        }
    }

    static int getlen(int r,int l,int a){
        return (r-l+1+1)/(a+1);
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class Pair  {
    int first, second;

    public Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }

}

class Tempo {

    int num;
    int index;

    public Tempo(int num, int index) {
        this.num = num;
        this.index = index;
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
                ans.add("removeMin");
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    ans.add("getMin " + num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                    ans.add("getMin " + num);
                }
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
                ans.add("removeMin");
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    ans.add("getMin " + num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                        ans.add("getMin " + num);
                    }
                }
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = Integer.parseInt(scanner.nextLine());
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        StringBuilder ans = new StringBuilder();
        int cnt = 0;
        while (t-- > 0) {
            String inp = scanner.nextLine();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.append("insert 0\n");
                    ++cnt;
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.append("insert ").append(num).append("\n");
                    ++cnt;
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.append("removeMin\n");
                        ++cnt;
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.append("insert ").append(num).append("\n");
                        ++cnt;
                    }
                }
            }
            ans.append(inp).append("\n");
            ++cnt;
        }
        System.out.println(cnt);
        System.out.println(ans);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String inp = scanner.next();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                }
            }
            System.out.println(inp);
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
                ans.add("removeMin");
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    ans.add("getMin " + num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                        ans.add("getMin " + num);
                    } else
                        ans.add("getMin" + num);
                }
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (!Q.isEmpty())
                    Q.remove();
                ans.add("removeMin");
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                }
                ans.add("getMin " + num);
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = Integer.parseInt(scanner.nextLine());
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        StringBuilder ans = new StringBuilder();
        int cnt = 0;
        while (t-- > 0) {
            String inp = scanner.nextLine();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.append("insert 0\n");
                    ++cnt;
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.append("insert ").append(num).append("\n");
                    ++cnt;
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.append("removeMin\n");
                        ++cnt;
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.append("insert ").append(num).append("\n");
                        Q.add(num);
                        ++cnt;
                    }
                }
            }
            ans.append(inp).append("\n");
            ++cnt;
        }
        System.out.println(cnt);
        System.out.println(ans);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        int t = Integer.parseInt(scanner.nextLine());
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        StringBuilder ans = new StringBuilder();
        int cnt = 0;
        while (t-- > 0) {
            String inp = scanner.nextLine();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.append("insert ").append(num).append("\n");
                    ++cnt;
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.append("insert ").append(num).append("\n");
                    ++cnt;
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.append("removeMin\n");
                        ++cnt;
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.append("insert ").append(num).append("\n");
                        ++cnt;
                    }
                }
            }
            ans.append(inp).append("\n");
            ++cnt;
        }
        System.out.println(cnt);
        System.out.println(ans);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
//        Scanner scanner = new Scanner(System.in);
        BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
        int t = Integer.parseInt(reader.readLine());
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String inp = reader.readLine();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                }
            }
            ans.add(inp);
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String inp = scanner.nextLine();
            String[] input = inp.split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                }
            }
            ans.add(inp);
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    ans.add("delete " + num);
                } else {
                    Q.remove();
                    ans.add("removeMin");
                }
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    ans.add("getMin " + num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                        ans.add("getMin " + num);
                    }
                }
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        PriorityQueue<Integer> Q = new PriorityQueue<>();
        ArrayList<String> ans = new ArrayList<>();
        while (t-- > 0) {
            String[] input = scanner.nextLine().split(" ");
            String cmd = input[0];
            int num = 0;
            if (input.length > 1)
                num = Integer.parseInt(input[1]);
            if (cmd.equals("insert")) {
                Q.add(num);
                ans.add("insert " + num);
            } else if (cmd.equals("removeMin")) {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                } else {
                    Q.remove();
                }
                ans.add("removeMin");
            } else {
                if (Q.isEmpty()) {
                    ans.add("insert " + num);
                    Q.add(num);
                } else {
                    int x = Q.peek();
                    while (x < num) {
                        Q.remove();
                        ans.add("removeMin");
                        if (Q.isEmpty())
                            break;
                        else
                            x = Q.peek();
                    }
                    if (Q.isEmpty() || Q.peek() > num) {
                        ans.add("insert " + num);
                    }
                }
                ans.add("getMin " + num);
            }
        }
        System.out.println(ans.size());
        for (String x : ans)
            System.out.println(x);
    }
}


#include<iostream>
#include<queue>
using namespace std;
long long a[100000]  , ansa[100000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[100000] , ans[100000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(i != t-1)
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i] <<endl;
			else
				cout<<endl;
		else
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i];

	}
}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans  ;

string chand(int a){
	string d , s;
	while(a!=0){
		d = d + char(a%10 + 48) ;
		a /= 10 ;
	}
	for(int i=d.size()-1 ; i!=-1 ; i--){
		s = s + d[i] ;
	}
	return s;
}

int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans = ans + "insert" + " " + chand(a[i]) + '\n';
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans = ans + "removeMin" + '\n';
				t += 1;
			}
			else{
				ans = ans + "insert 0" + '\n' ;
				t += 1;
				ans = ans + "removeMin" + '\n';
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans = ans + "removeMin" + '\n';
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans = ans + "getMin" + " " + chand(v) + '\n';
				t += 1;
 			}
 			else {
 				ans = ans + "insert" + " " + chand(v) + '\n';
				pq.push(v) ;
				t += 1;
				ans = ans + "getMin" + " " + chand(v) + '\n';
				t += 1;
			}

		}

	}
	cout<<t<<endl ;

	cout<<ans;
}


#include<iostream>
#include<queue>
using namespace std;
long long a[1000000]  , ansa[1000000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[1000000] , ans[1000000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(i != t-1)
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i] <<endl;
			else
				cout<<endl;
		else
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i];

	}
}


#include<bits/stdc++.h>
using namespace std;
string chand(int a){
	int b= 0 ;
	if(a == 0)
		return "0" ;
	string d ;
	if(a < 0){
		b = 1;
		a = -1 * a;
	}
	while(a!=0){
		d = d + char(a%10 + 48) ;
		a /= 10;
	}
	reverse(d.begin() , d.end()) ;
	if(b == 1)
		d = "-" + d;
	return d;
}

int main(){
	string ans = "";
	priority_queue< int, vector<int>, greater<int> > pq;
	int n;
	long long t = 0;
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		string s;
		cin >>s ;

		if(s == "insert"){
			int v;
			cin >>v ;
			pq.push(v) ;
			t += 1;
			ans = ans + s + " " + chand(v) + '\n' ;
			continue ;
		}
		if(s == "removeMin"){
			if(!pq.empty()){
				pq.pop() ;
				ans = ans + s + '\n' ;
				t += 1;
			}
			else{
				ans = ans + "insert 0" + '\n' + s + '\n' ;
				t += 2 ;
			}
			continue ;
		}
		int v;
		cin >>v ;
		while(!pq.empty() && pq.top() < v){
			ans = ans + "removeMin" + '\n' ;
			t += 1 ;
			pq.pop() ;
		}
		if(!pq.empty() && pq.top() == v){
			ans = ans + s + " " + chand(v) + '\n' ;
			t += 1;
		}
		else{
			pq.push(v) ;
			t += 2;
			ans = ans + "insert " + chand(v) + '\n' + s + " " + chand(v) + '\n';
		}

	}
	cout<<t << endl <<ans ;
}


#include<iostream>
#include<queue>
using namespace std;
int a[10000]  , ansa[10000] , n , t , v ;
priority_queue<int , vector<int> , greater<int> > pq ;
string s[10000] , ans[10000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(i != t-1)
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i] <<endl;
			else
				cout<<endl;
		else
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i];

	}
}


#include<iostream>
#include<queue>
using namespace std;
long long a[100000]  , ansa[100000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[100000] , ans[100001] ;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(long long i=0 ; i!=t-1 ; i++){
		cout<<ans[i];
		if(ans[i] != "removeMin")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}
	cout<<ans[t-1] ;
	if(ans[t-1] != "removeMin")
		cout<<" "<<ansa[t-1];

}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , ansa[200000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans[200010] , h;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			h = "";
			while(!pq.empty() && pq.top() < v){
				pq.pop() ;
				h = h + "removeMin" + '\n';

			}
			if(h != ""){
 				ans[t] = h;
 				t += 1;
 			}
 			ans[t] = "insert" ;
			ansa[t] = v ;
			pq.push(v) ;
			t += 1;
			ans[t] = "getMin" ;
			ansa[t] = v ;
			t += 1;
		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(ans[i] == "getMin" || ans[i] == "insert")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}

}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , ansa[200000] , n , t , v , u ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans[200010] , h;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			h = "";
			while(!pq.empty() && pq.top() < v){
				pq.pop() ;
				h = h + "removeMin" + '\n';
				u += 1;
			}
			u -= 1;
			if(h != ""){
 				ans[t] = h;
 				t += 1;
 			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}
		}

	}
	cout<<t+u<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(ans[i] == "getMin" || ans[i] == "insert")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}

}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , ansa[200000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans[200010] , h;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			h = "";
			while(!pq.empty() && pq.top() < v){
				pq.pop() ;
				h = h + "removeMin" + '\n';

			}
			if(h != ""){
 				ans[t] = h;
 				t += 1;
 			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}
		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(ans[i] == "getMin" || ans[i] == "insert")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}

}


#include<iostream>
#include<queue>
using namespace std;
long long a[100000]  , ansa[100000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[100000] , ans[100010] ;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(long long i=0 ; i!=t-1 ; i++){
		cout<<ans[i];
		if(ans[i] != "removeMin")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}
	cout<<ans[t-1] ;
	if(ans[t-1] != "removeMin")
		cout<<" "<<ansa[t-1];

}


#include<iostream>
#include<queue>
using namespace std;
int a[10000]  , ansa[10000] , n , t , v ;
priority_queue<int , vector<int> , greater<int> > pq ;
string s[10000] , ans[10000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else{
 				ans[t] = "insert" ;
				ansa[t] = v ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(i != t-1)
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i] <<endl;
			else
				cout<<endl;
		else
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i];

	}
}


#include<bits/stdc++.h>
using namespace std;
string chand(long long a){
	int b= 0 ;
	if(a == 0)
		return "0" ;
	string d ;
	if(a < 0){
		b = 1;
		a = -1 * a;
	}
	while(a!=0){
		d = d + char(a%10 + 48) ;
		a /= 10;
	}
	reverse(d.begin() , d.end()) ;
	if(b == 1)
		d = "-" + d;
	return d;
}

int main(){
	string s;
	string ans;
	priority_queue< int, vector<int>, greater<int> > pq;
	int n;
	int v;
	cin >>n;
	int t;
	for(int i=0 ; i!=n ; i++){

		cin >>s ;

		if(s == "insert"){
			cin >>v ;
			pq.push(v) ;
			t += 1;
			ans = ans + "insert " + chand(v) + '\n' ;
			continue ;
		}
		if(s == "removeMin"){
			if(!pq.empty()){
				pq.pop() ;
				ans = ans + "removeMin" + '\n' ;
				t += 1;
			}
			else{
				ans = ans + "insert 0" + '\n' + "removeMin" + '\n' ;
				t += 2 ;
			}
			continue ;
		}

		cin >>v ;
		while(!pq.empty() && pq.top() < v){
			ans = ans + "removeMin" + '\n' ;
			t += 1 ;
			pq.pop() ;
		}
		if(!pq.empty() && pq.top() == v){
			ans = ans + "getMin" + " " + chand(v) + '\n' ;
			t += 1;
		}
		else{
			pq.push(v) ;
			t += 2;
			ans = ans + "insert " + chand(v) + '\n' + "getMin " + chand(v) + '\n';
		}

	}
	cout<<t << endl <<ans ;
}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans  ;

string chand(long long a){
	string d , l ;
	int b=0 ;
	if(a < 0){
		a = -1 * a ;
		b = 1;
	}
	while(a!=0){
		d = d + char(a%10 + 48) ;
		a /= 10 ;
	}
	for(int i=d.size()-1 ; i!=-1 ; i--){
		l = l + d[i] ;
	}
	if(b == 1)
		l = "-" + l;
	return l;
}

int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans = ans + "insert" + " " + chand(a[i]) + '\n';
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans = ans + "removeMin" + '\n';
				t += 1;
			}
			else{
				ans = ans + "insert 0" + '\n' ;
				t += 1;
				ans = ans + "removeMin" + '\n';
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans = ans + "removeMin" + '\n';
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans = ans + "getMin" + " " + chand(v) + '\n';
				t += 1;
 			}
 			else {
 				ans = ans + "insert" + " " + chand(v) + '\n';
				pq.push(v) ;
				t += 1;
				ans = ans + "getMin" + " " + chand(v) + '\n';
				t += 1;
			}

		}

	}
	cout<<t<<endl ;

	cout<<ans;
}


#include<iostream>
#include<queue>
using namespace std;
long long a[100000]  , ansa[100010] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[100000] , ans[100010] ;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(long long i=0 ; i!=t-1 ; i++){
		cout<<ans[i];
		if(ans[i] != "removeMin")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}
	cout<<ans[t-1] ;
	if(ans[t-1] != "removeMin")
		cout<<" "<<ansa[t-1];

}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , ansa[200000] , n , t , v , u ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[200000] , ans[200010] , h;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			h = "";
			while(!pq.empty() && pq.top() < v){
				pq.pop() ;
				h = h + "removeMin" + '\n';
				u += 1;
			}
			if(h != ""){
 				ans[t] = h;
 				t += 1;
 			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}
		}

	}
	cout<<t+u-1<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(ans[i] == "getMin" || ans[i] == "insert")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}

}


#include<bits/stdc++.h>
using namespace std;
priority_queue<int> pq;
int n , v , t;
string s[100000] , ans;
string chand(int a){
	int b= 0 ;
	if(a == 0)
		return "0" ;
	string d ;
	if(a < 0){
		b = 1;
		a = -1 * a;
	}
	while(a!=0){
		d = d + char(a%10 + 48) ;
		a /= 10;
	}
	reverse(d.begin() , d.end()) ;
	if(b == 1)
		d = "-" + d;
	return d;
}

int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){

		cin >>s[i] ;

		if(s[i] == "insert"){
			cin >>v ;
			pq.push(v) ;
			t += 1;
			ans = ans + "insert " + chand(v) + '\n' ;
			continue ;
		}
		if(s[i] == "removeMin"){
			if(!pq.empty()){
				pq.pop() ;
				ans = ans + "removeMin" + '\n' ;
				t += 1;
			}
			else{
				ans = ans + "insert 0" + '\n' + "removeMin" + '\n' ;
				t += 2 ;
			}
			continue ;
		}

		cin >>v ;
		while(!pq.empty() && pq.top() < v){
			ans = ans + "removeMin" + '\n' ;
			t += 1 ;
			pq.pop() ;
		}
		if(!pq.empty() && pq.top() == v){
			ans = ans + "getMin" + " " + chand(v) + '\n' ;
			t += 1;
		}
		else{
			pq.push(v) ;
			t += 2;
			ans = ans + "insert " + chand(v) + '\n' + "getMin " + chand(v) + '\n';
		}

	}
	cout<<t << endl <<ans ;
}


#include<iostream>
#include<queue>
using namespace std;
long long a[200000]  , n , t , v , u ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
priority_queue<long long , vector<long long> , greater<long long> > pq2 ;
string s[200000] ,  h;
int main(){
	cin >>n;
	for(long long i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			u += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){
			if(!pq.empty()){
				pq.pop() ;
				u += 1;
			}
			else{
				u += 1;
				u += 1;
			}

		}

		else{
			cin >>a[i] ;
			v = a[i] ;
			h = "" ;
			while(!pq.empty() && pq.top() < v){
				pq.pop() ;
				u += 1;
			}
			if(!pq.empty() && pq.top() == v){
				u += 1;
 			}
 			else {
 				pq.push(v) ;
				u += 1;
				u += 1;
			}
		}

	}
	cout<<u<<endl ;
	for(int i=0 ; i!=n ; i++){

		if(s[i] == "insert"){
			cout<< "insert " ;
			cout<< a[i] <<endl;
			pq2.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq2.empty()){
				pq2.pop() ;
				cout<< "removeMin"<<endl ;
			}
			else{
				cout<< "insert 0" <<endl;
				cout<<"removeMin" <<endl;
			}

		}

		else{
			v = a[i] ;
			h = "";
			while(!pq2.empty() && pq2.top() < v){
				pq2.pop() ;
				cout <<"removeMin" <<endl;
			}
			if(!pq2.empty() && pq2.top() == v){
				cout << "getMin"<<" "<<v <<endl;
 			}
 			else {
 				cout<< "insert" <<" "<<v <<endl;
				pq2.push(v) ;
				cout <<"getMin"<<" "<<v<<endl ;
			}
		}

	}

}


#include<iostream>
#include<queue>
using namespace std;
long long a[1000000]  , ansa[1000000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[1000000] , ans[1000000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t-1 ; i++){
		cout<<ans[i];
		if(ans[i] != "removeMin")
			cout<<" "<<ansa[i] <<endl;
		else
			cout<<endl;

	}
	cout<<ans[t-1] ;
	if(ans[t-1] != "removeMin")
		cout<<" "<<ansa[t-1];

}


#include<iostream>
#include<queue>
using namespace std;
int n , a[100000] , t ,  v , q;
string s[10000] ;
priority_queue<int, vector<int> , greater<int> > pq ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >> s[i] ;

		if(s[i] == "insert"){
			cin >>a[i] ;
			pq.push(a[i]) ;
		}
		else if(s[i] == "removeMin")
			pq.pop() ;
		else{
			cin >>a[i] ;
			t = a[i] ;
		}

	}
	v = n ;
	while(!pq.empty() && pq.top() < t){
		pq.pop() ;
		q += 1;
	}
	cout<<v + q + 1<<endl;
	for(int i=0 ; i!=n-1 ; i++){
		if(s[i] == "removeMin")
			cout<<s[i]<<endl ;
		else
			cout<<s[i]<<" "<<a[i]<<endl ;
	}
	for(int i=0 ; i!=q ; i++)
		cout<<"removeMin"<<endl ;

	cout<<"insert"<<" "<<t <<endl;
	cout<<"getMin"<<" "<<t ;

}


#include<iostream>
#include<queue>
using namespace std;
long long a[1000000]  , ansa[1000000] , n , t , v ;
priority_queue<long long , vector<long long> , greater<long long> > pq ;
string s[10000000] , ans[10000000] ;
int main(){
	cin >>n;
	for(int i=0 ; i!=n ; i++){
		cin >>s[i] ;
		if(s[i] == "insert"){
			cin >>a[i] ;
			ans[t] = "insert" ;
			ansa[t] = a[i] ;
			t += 1;
			pq.push(a[i]) ;

		}

		else if(s[i] == "removeMin"){

			if(!pq.empty()){
				pq.pop() ;
				ans[t] = "removeMin" ;
				t += 1;
			}
			else{
				ans[t] = "insert" ;
				ansa[t] = 0 ;
				t += 1;
				ans[t] = "removeMin" ;
				t += 1;
			}

		}

		else{
			cin >>v ;
			while(!pq.empty() && pq.top() < v){
				ans[t] = "removeMin" ;
				t += 1;
				pq.pop() ;
			}
			if(!pq.empty() && pq.top() == v){
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
 			}
 			else {
 				ans[t] = "insert" ;
				ansa[t] = v ;
				pq.push(v) ;
				t += 1;
				ans[t] = "getMin" ;
				ansa[t] = v ;
				t += 1;
			}

		}

	}
	cout<<t<<endl ;
	for(int i=0 ; i!=t ; i++){
		cout<<ans[i];
		if(i != t-1)
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i] <<endl;
			else
				cout<<endl;
		else
			if(ans[i] != "removeMin")
				cout<<" "<<ansa[i];

	}
}