char s[11],a[3000][11];i,l,r,n;c(a,b){return strcmp(a,b);}main(t){n=strlen(gets(s));for(t<<=n;t--;l=0)for(i=r=n;i--;a[t][i]=s[t&1<