class CapsLock attr_reader :s def initialize(s: "") @s = s end def datainput begin @s = gets.chomp rescue end end def dataoutput puts @s.swapcase end def run datainput dataoutput end end if $0 == __FILE__ CapsLock.new.run end