process.stdin.resume();
process.stdin.setEncoding("utf8");

const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

const lines = [];

reader.on("line", (line) => {
  lines.push(line);
});

reader.on("close", () => {
  let disp = "";
  const s = lines[0];
  for (let i = 0; i < s.length; i++) {
    const c = s[i];
    if ("A" <= c && c <= "Z") disp += c.toLowerCase();
    else disp += c.toUpperCase();
  }
  console.log(disp);
});

