function main(input) {
  let s = input.trim();
  let n = s.length;

  let ans = "";
  for (let i = 0; i < n; i++) {
    if ("A" <= s[i] && s[i] <= "Z") {
      ans += s[i].toLowerCase();
    } else {
      ans += s[i].toUpperCase();
    }
  }
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
