import re
a = input()
s = re.sub(r'[^a-zA-Z]',' ',a)
print(" ".join(s.split()[::-1]))