for(A=[O=b=c=''];l=readline();)b+=l+0;[b,I]=b.split('!') for([,$]in b)(t={'>':'++P','<':'--P','+':'A[P]=-~A[P]','-':'A[P]=~-A[P]','.':'O+=String.fromCharCode(A[P])',',':'A[P]=I.charCodeAt(X++)','[':'while(A[P]){',']':'}'}[$])?c+=t+';':P=X=0 eval(c) print(O.replace(' W',', w'))