start_number, end_number = gets.chomp.split(" ").map(&:to_i) for i in start_number..end_number do puts i if i % 3 == 0 || i.to_s.include?("3") end