str = gets
ans = ""
str.length.times do |i|
  tmp = str[i..i]
  if "a" <= tmp && tmp <= "z"
    tmp = (tmp.ord - "a".ord + "A".ord).chr
  elsif "A" <= tmp && tmp <= "Z"
    tmp = (tmp.ord - "A".ord + "a".ord).chr
  end
  ans += tmp
end
print ans

