while True: try: s = input() s = s.replace("$"," ") s = s.replace("*", " ") s = s.replace("!", " ") s = s.replace("#", " ") s.lstrip() lst = s.split(" ") for i in lst[::-1]: print(i,end=" ") except: break