z=input();B=z.split();M='i[::-1].translate({41:40,40:41,125:123,123:125,62:60,60:62,93:91,91:93})';f=B+[eval(M)for i in B if eval(M)not in B];d=[f.pop(0)]for h in d: try:d.append([f.pop(f.index(c))for c in f if h[-1]==c[0]][0]) except:breakprint(''.join(d)if len(d)>=len(B)else'')
(-] ]-> >-} }-) )-[ [-< <-{ {-(
(-]]->>-}}-))-[[-<<-{{-((-{{-<
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!