line = STDIN.gets.chomp

for i in 0..line.length - 1 do
  if line[i].ord >= 65 && line[i].ord <=90 then
    line[i] = (line[i].ord + 32).chr
  elsif line[i].ord >=97 && line[i].ord <= 122 then
    line[i] = (line[i].ord - 32).chr
  end
end

puts line