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