main(c,P){char*p=gets(P);for(;c=getchar(),~c;c<11?p=P:c&1?*p++-=c-44:++p);puts(P);}