#include<time.h>
                            #include<stdio.h>/*8/2000*/
                        #include<stdlib.h>/*SY!*//*E!*//*:)*/
                     int/***/i,j,k,e,s,u=183,v=4,m,n,x[512],t,c;
                  char/******/z[99999]="Zenum{x=Y127,y,z};Zch"/*****/
                "ar\40t[z"/***************/"];Yint\40i,j,"/**********/
              "k;Zmai"/**/"n("/************************************/"Y"
             "int\40c,Zchar"/**/"*"/****************************/"*a){Yf"
            "or(i"/**/"=j=t[x]=t[y]=0;i<"/*******************/"y"/**/";jX"
          "++)Yfor(k=0;i<yX&&a[j%c][k];t[i"/**/"X++]"/***/"=a[j%c][kX++])"
         ";Yfor(;c<x;cX++){t[(@)&x]=t[(@)&x];iX+=@;jX-=@;kX++;}Zputs(t);}",
        *p[]={"~@","@+@","@-@","@&@","@|@","@^@","(@)","@?@:@"},*q="ijkxyzc"
     "123456789Lain";void/**/main(       void){srand(time(NULL));c=x[t=0]=0;
   for  (j=10;j>0;j=getchar()){e=(       j-10)?j>32?x[t]>0?++x[t]|c++:(x[++t]
  =1)   |c++:x[t]<0?x[t]--: (x[++t        ]=- 1):(x[++t]=0);}for(x[++t]=99999
       +99;u<c;){k=rand /*  @_@ ;;         */   ()%v;for(i=j=0;j<=k;i++){if(z
       [i]==64)j++;}i--      ;m                 =u--;n=v--;do{e=rand()&7;m=u;
      n=v;for(j=0;p[e]  [j];j++){             if(p[e][j]==64)n++;m++;}}while(
      m>c+1);u=m;v=n;for(s=  k=0;z           [s];s  ++);for(;s>=i;z[(s  --)+j
      -1 ]=z[s]);for(;p[e][k];z[i+            k++]=p[e][k]);}for(i=0     ;z[
     i]   ;i++){if(z[i  ]==64)z[i                ]=q[rand()& 15] ;}     for
          (t=t=i=k=0;z       [i]                  ;t++){if  ( x [t]    !=0)
           {if(x[t]>0){    for(j                =(z[i]>87   && z[i  ]<91)?
           z[i ++]-86:1                                    ;  j --  >00;x
            [t  ]--)e=k?                                    k--: putchar
             (0   *0+z[i++                                  ]);;e=x[t]>
             0?    t--:(k=-x                               [t]);}else{
              /*      */for(;x                         [   t];++x /*
               */      [t    ])e=k                 ?k--:  putchar  (
               32       );      }}else          {;k=!     putchar  (
                                     10);}}putchar       /*  **/   (
                                                        /*  ****
                                                       **  */10
                                                          )/*
                                                          ***
                                                         ***
                                                        ***
                                                       */
                                                      ;}