process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk)
{
  var text = chunk;
  var out = "";
  for (var c of text) {
    if (c == c.toLowerCase()) {
      out += c.toUpperCase();
    } else {
      out += c.toLowerCase();
    }
  }
  console.log(out);
});