#!/usr/bin/python # -*- coding: utf-8 -*- S = raw_input() ans = "" for i in xrange(len(S)): if S[i].islower(): ans += S[i].upper() else: ans += S[i].lower() print ans