using System;
public class Program
{
public static void Main()
string str = Console.ReadLine();
string final = "";
char store;
char[] a = str.ToCharArray();
for (int i = 0; i < a.Length; ++i)
char letter = a[i];
if(char.IsLower(a[i]))
store = char.ToUpper(letter);
else
store = char.ToLower(letter);
final += store;
}
Console.WriteLine("{0}", final);