https://vjudge.net/problem/51197/origin
#include<bits/stdc++.h>
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<algorithm>
#include<stack>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif // ONLIN
string s;
int a,b;int n;int c;
while(cin>>s)
{
n=s.size();
a=0;b=0;c=0;
for(int i=0;i<n;i++)
{
if(s[i]=='0'&&s[(i+1)%n]=='0')a++;
if(s[i]=='0')b++;
if(s[i]=='1')c++;
}
if(c==0){cout<<"EQUAL"<<endl;continue;}
if(a*n==b*b){cout<<"EQUAL"<<endl;}
else if(a*n>b*b){cout<<"SHOOT"<<endl;}
else cout<<"ROTATE"<<endl;
}
}