a = input() 
for i in a: 
    if not i.isalpha(): 
        a = a.replace(i,' ') 
        b = a.split()
print(*b[::-1])