small=[chr(i) for i in range(97,123)]
big=[chr(i) for i in range(65,91)]
x=input()
for i in x:
    if i not in small+big:
        x=x.replace(i," ")
y=x.split()
z=y[::-1]
z=" ".join(z)
print(z)