import re x = list(str(input())) y = [] for i in x: if re.search(r'[^a-zA-Z]+', i) is not None: y.append(' ') else: y.append(i) y = ''.join(y).split(' ') y = list(reversed(y)) y = ' '.join(y) print(y)