class Solution: def trans(self , s: str, n: int) -> str: # write code here nums = [i.swapcase() for i in s.split(' ')[::-1]] return ' '.join(nums)