import re
print(' '.join(re.sub('[^A-Za-z]+',' ',input()).split(' ')[::-1]))