a,b=gets.chomp.split.map(&:to_i) (a..b).each { |i| puts i if i % 3 == 0 || i.to_s.split("").include?("3") }