def sekai(a, b) (a..b).each{|i| if i % 3 == 0 puts i elsif i.to_s.split('').to_a.include?('3') puts i end } end a, b = gets.split(' ').map(&:to_i) sekai(a, b)