#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param s string字符串 
# @param n int整型 
# @return string字符串
#
class Solution:
    def trans(self , s: str, n: int) -> str:
        # write code here
        l=s.split(" ")
        l.reverse()
        result=""
        for item in l:
            result=result+item+" "
        new=result
        new=new[0:-1]
        s=list(new)
        y=""
        for i in range(len(s)):
            if s[i].islower():
                s[i]=s[i].upper()
            elif s[i].isupper():
                s[i]=s[i].lower()
            y=y+s[i]
        return y