arr = list(input())
# 将所有非字母替换成空格
for i, ch in enumerate(arr):
    if not ch.isalpha():
        arr[i] = " "
# 从列表变成一个字符串
string = "".join(arr)
words = string.split(" ")
for word in words[::-1]:
    if word != "":
        print(word, end=" ")