a,b = gets.chomp.split(" ").map(&:to_i) [*a..b].each{|n| if n % 3 == 0 || n.to_s["3"] puts n end }