a = input()
for i in a:
    if not i.isalpha(): #判断是否为字母
        a = a.replace(i, ' ') #将非字母替换为空格
b = a.split()
print(' '.join(b[::-1]))