import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.ascii, std.regex, std.conv, std.stdio, std.typecons;

void main()
{
  auto s = readln.chomp;

  dchar swapCase(dchar c) {
    if (c.isLower) return std.ascii.toUpper(c);
    else if (c.isUpper) return std.ascii.toLower(c);
    else return c;
  }

  writeln(s.map!(swapCase));
}