char s[];p(x){putchar(x);}f(b,e,m){p('{')+(e+~b?f(b,m=b-~e>>1)+f(m,e):p(s[b]))+p('}');}main(){f(0,read(0,s,s));}