char s[9];i,j,k;main(){for(gets(s);!s[++j]?k=k-i?s[i]^=s[k]^=s[i]^=s[k]:++i,k==i&&s[j=i]:s[j]/s[k]?k=j:1;);i=!puts(s);}