def swap_case(s):
    a = ''.join(map(str.swapcase, s))
    return a

#==================== GIVEN ======================#
if __name__ == '__main__':
    s = raw_input()
    result = swap_case(s)
    print result
#===================== END =========================#