#include #include using namespace std; using namespace atcoder; #define all(s) (s).begin(), (s).end() #define rall(s) (s).rbegin(), (s).rend() #define rep(i,l,r) for(int i=l;i=l;i--) using ll=long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string S;cin>>S; set st; rep(b,0,1<<(int)S.size()){ deque d;rep(i,0,(int)S.size())d.push_back(S[i]); string t; rep(j,0,S.size()){ char ch; if(b>>j&1){ ch=d.front(); d.pop_front(); } else{ ch=d.back(); d.pop_back(); } t+=ch; } st.insert(t); } cout<