class Somehow attr_reader :a, :b def initialize(a: 0, b: 0) @a, @b = a, b @array = [] end def datainput begin @a, @b = gets.chomp.split.map { |v| Integer(v) } rescue end end def multiples3(a, b) (a..b).each do |i| @array << i if i % 3 == 0 or i.to_s.include?("3") end @array.sort end def dataoutput puts multiples3(@a, @b) end def run datainput dataoutput end end if $0 == __FILE__ Somehow.new.run end