import java.util.Scanner; import java.io.*; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); ArrayList stoc = new ArrayList(); int i = 0; for (Character c : str.toCharArray()){ stoc.add(i, c); i++; } for (i = 0; i < stoc.size(); i++) { Character temp = stoc.get(i); if (!((Character.toUpperCase(temp)) != stoc.get(i))) stoc.set(i, Character.toLowerCase(temp)); else if (!((Character.toLowerCase(temp)) != stoc.get(i))) stoc.set(i, Character.toUpperCase(temp)); } for (i = 0; i < stoc.size(); i++) System.out.printf("%c", stoc.get(i)); System.out.printf("\n"); } }