const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const arr = [...input];
let result = [];
arr.forEach(item => {
  if(/[a-z]/.test(item)){
    result.push(item.toUpperCase());
  } else if(/[A-Z]/.test(item)) {
    result.push(item.toLowerCase());
  } else {
    result.push(item);
  }
})
console.log(result.join("").trim());
