def solve(s):
    flg = 0
    idx = 0
    new_str = list(s)
    for i in s:
        if i.isalpha():
            new_str[idx] = i.swapcase()
            flg = 1
        idx += 1
    s = ""
    for i in new_str:
        s += i
    if flg == 0:
        return s[len(s)::-1]
    return s
def solve(i2):
    flg = 0
    idx = 0
    new_str = list(i2)
    for i in i2:
        if i.isalpha():
            new_str[idx] = i.swapcase()
            flg = 1
           
        idx += 1
    i2 = ""
    for i in new_str:
        i2 += i
    if flg == 0:
        return i2[len(i2) :: -1]
    return i2