data = input() data2 = [] for i in data: if 'a'<=i<='z' or 'A'<=i<='Z': data2.append(i) else: data2.append(' ') b = ''.join(data2) list_data = b.split(' ') for i in range(len(list_data)-1,-1,-1): print(list_data[i],end=' ')