#!/usr/bin/env python3 #fileencoding: utf-8 print("".join([(lambda x: x.lower() if x.isupper() else x.upper())(i) for i in input().strip()]))