import re
s = input()
f = re.sub('[^\w]',' ',s)
f = f.split()
print(*f[::-1])