#include #include #include using namespace std; string s; set >S; main() { cin>>s; int x=0,y=0; string n="abc"; S.insert(make_pair(x,y)); long long cnt; cnt=0; for(char t:s) { if(cnt%2==0) { if(n[0]==t) { y++; //swap(n[1],n[2]); } else if(n[1]==t) { x++; y--; swap(n[0],n[2]); } else { x--; y--; swap(n[0],n[1]); } } else { if(n[0]==t) { y--; //swap(n[1],n[2]); } else if(n[1]==t) { x++; y++; swap(n[0],n[2]); } else { x--; y++; swap(n[0],n[1]); } } cnt++; S.insert(make_pair(x,y)); } cout<