#include using namespace std; using ll = long long; const long long INF = 1001001001; const long long MOD = /**/1000000007;//*/998244353; const double EPS = 1e-10; int main(){ cin.tie(0); ios::sync_with_stdio(false); string s; cin>>s; set> st; int y=0,x=0,rev=0; st.insert(make_pair(y,x)); char bot='c',top='d',le='a',ri='b'; for(int i=0;i