str = gets str.each_char do |c| if c.ord >= "A".ord && c.ord <= "Z".ord print (c.ord + 32).chr else print (c.ord - 32).chr end end puts