a, b = gets.chomp.split.map &:to_i (a..b).each{|i| i_s = i.to_s if i % 3 == 0 or i_s.chars.count('3') >= 1 p i end }