#include <iostream>
using namespace std;
int f[10000000]{};
int main()
{
//ios::sync_with_stdio(false);
//cin.tie(0);
int n;
while(cin>>n)
{
for(int i=0;i<n;i++){
string l;
cin>>l;
int a,b,c,d,region,min=2147483647;
if(l=="load")
{
cin>>c;
if(f[c-1]==0)cout<<"fail to load from "<<c<<"\n";
else
{
cout<<"load from region "<<f[c-1]<<"\n";
}
}
else if(l=="map")
{
cin>>region>>a>>b;
bool t=true;
for(int i=a-1;i<=b-1;i++)
{
if(f[i]!=0 and f[i]<min){min=f[i];t=false;}
}
if(!t)
{cout<<"fail to create region "<<region<<", overlap with region "<<min<<"\n";}
else if(t)
{
for(int i=a-1;i<=b-1;i++)
{
f[i]=region;
}
cout<<"region "<<region<<" created\n";
}
}
else if(l=="store")
{
cin>>d;
if(f[d]!=0)cout<<"store to region "<<f[d]<<"\n";
else
{
cout<<"fail to store to "<<d<<"\n";
}
}
}
}
}
NA 20%