#include<iostream>
using namespace std;
int main()
{
int a1,b1,c1;cin>>a1>>b1>>c1;
int a2,b2,c2;cin>>a2>>b2>>c2;
int n;cin>>n;
for(int i=0;i<n;i++)
{
string op,s;cin>>op>>s;
if(op=="777777777Plus")
{
if(s=="head")
{
if(c1>0) c1-=100;
else
{
cout<<"SW2000"<<endl;
return 0;
}
}
if(s=="body")
{
if(b1>0) b1-=30;
else
{
a1-=30;
if(a1<=0)
{
cout<<"SW2000"<<endl;
return 0;
}
}
}
if(s=="limbs")
{
a1-=10;
if(a1<=0)
{
cout<<"SW2000"<<endl;
return 0;
}
}
}
else
{
if(s=="head")
{
if(c2>0) c2-=100;
else
{
cout<<"777777777Plus"<<endl;
return 0;
}
}
if(s=="body")
{
if(b2>0) b2-=30;
else
{
a2-=30;
if(a2<=0)
{
cout<<"777777777Plus"<<endl;
return 0;
}
}
}
if(s=="limbs")
{
a2-=10;
if(a2<=0)
{
cout<<"777777777Plus"<<endl;
return 0;
}
}
}
}
return 0;
}