
s=input()
def add_str(temp):
global result
t=list(temp)
t.reverse()
for i in t:
result+=i
result=''
temp=''
flag=0
for ch in s:
if ch=='<':
flag=1
add_str(temp)
temp=''
result+=ch
continue
elif ch=='>':
flag=0
result+=ch
continue
elif ch==' ':
add_str(temp)
temp=''
result+=ch
continue
if flag==1:
result+=ch
elif flag==0:
temp+=ch
if temp!='':
add_str(temp)
print(result)