import re
w = input()
m = re.compile(r'[a-zA-Z]*')
c = re.findall(m, w)
c = [i for i in c if i.isalpha()]
print(' '.join(c[::-1]))
解决单词倒排问题
import re
w = input()
m = re.compile(r'[a-zA-Z]*')
c = re.findall(m, w)
c = [i for i in c if i.isalpha()]
print(' '.join(c[::-1]))
解决单词倒排问题