let input = require('fs').readFileSync('/dev/stdin', 'UTF-8');
let arr = input.split('');
let result = "";
for (let i=0; i<arr.length; i++) {
  let tmp = arr[i];
  if ( arr[i].match(/[a-z]/) ) {
    tmp = arr[i].toUpperCase();
  } else if (arr[i].match(/[A-Z]/) ) {
    tmp = arr[i].toLowerCase();
  }
  result += tmp;
}
console.log(result.trim());
