range = gets.split.map(&:to_i) range[0].upto(range[1]) do |i| if i%3==0 || i.to_s.include?("3") then puts i end end