S = input() res = "" for i in range(len(S)): if S[i] in string.ascii_lowercase: res += S[i].upper() elif S[i] in string.ascii_uppercase: res += S[i].lower() print(str(res))