#define P putchar( char s[];f(a,b,c){P'{');b-a?f(a,c=a+b>>1),f(c+1,b):P s[a]);P'}');}main(){f(!gets(s),918);}