import java.util.Scanner; public class Main { public static void main(String[] args) { //System.out.println("パスワード"); Scanner scanner = new Scanner(System.in); String pw = scanner.next(); scanner.close(); String[] pw_1 = new String[pw.length()]; for(int i = 0; i < pw.length(); i++) { String c = pw.substring(i,i+1); if( c.matches("[A-Z]{1}")) { pw_1[i] = c.toLowerCase(); }else if(c.matches("[a-z]{1}")) { pw_1[i] = c.toUpperCase(); }else { //System.out.println("無効な文字列です"); //System.exit(1); } } for( int i = 0; i < pw.length(); i++) { String s = pw_1[i]; System.out.print(s); } } }