class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
words = s.split()
return ' '.join(words[::-1])
if __name__ == '__main__':
s = Solution()
print(s.reverseWords(" hello world! "))